1
2
3
4
5
6
7
8 import sys
9 import getopt
10 import re as re_
11
12 etree_ = None
13 Verbose_import_ = False
14 ( XMLParser_import_none, XMLParser_import_lxml,
15 XMLParser_import_elementtree
16 ) = range(3)
17 XMLParser_import_library = None
18 try:
19
20 from lxml import etree as etree_
21 XMLParser_import_library = XMLParser_import_lxml
22 if Verbose_import_:
23 print("running with lxml.etree")
24 except ImportError:
25 try:
26
27 import xml.etree.cElementTree as etree_
28 XMLParser_import_library = XMLParser_import_elementtree
29 if Verbose_import_:
30 print("running with cElementTree on Python 2.5+")
31 except ImportError:
32 try:
33
34 import xml.etree.ElementTree as etree_
35 XMLParser_import_library = XMLParser_import_elementtree
36 if Verbose_import_:
37 print("running with ElementTree on Python 2.5+")
38 except ImportError:
39 try:
40
41 import cElementTree as etree_
42 XMLParser_import_library = XMLParser_import_elementtree
43 if Verbose_import_:
44 print("running with cElementTree")
45 except ImportError:
46 try:
47
48 import elementtree.ElementTree as etree_
49 XMLParser_import_library = XMLParser_import_elementtree
50 if Verbose_import_:
51 print("running with ElementTree")
52 except ImportError:
53 raise ImportError("Failed to import ElementTree from any known place")
54
55
68 return instring.lower()
69
70
71
72
73
74 ExternalEncoding = 'ascii'
75 Tag_pattern_ = re_.compile(r'({.*})?(.*)')
76 STRING_CLEANUP_PAT = re_.compile(r"[\n\r\s]+")
77
78
79
80
81
83 for idx in range(level):
84 outfile.write(' ')
85
87 if not inStr:
88 return ''
89 s1 = (isinstance(inStr, basestring) and inStr or
90 '%s' % inStr)
91 s1 = s1.replace('&', '&')
92 s1 = s1.replace('<', '<')
93 s1 = s1.replace('>', '>')
94 return s1
95
97 s1 = (isinstance(inStr, basestring) and inStr or
98 '%s' % inStr)
99 s1 = s1.replace('&', '&')
100 s1 = s1.replace('<', '<')
101 s1 = s1.replace('>', '>')
102 if '"' in s1:
103 if "'" in s1:
104 s1 = '"%s"' % s1.replace('"', """)
105 else:
106 s1 = "'%s'" % s1
107 else:
108 s1 = '"%s"' % s1
109 return s1
110
112 s1 = inStr
113 if s1.find("'") == -1:
114 if s1.find('\n') == -1:
115 return "'%s'" % s1
116 else:
117 return "'''%s'''" % s1
118 else:
119 if s1.find('"') != -1:
120 s1 = s1.replace('"', '\\"')
121 if s1.find('\n') == -1:
122 return '"%s"' % s1
123 else:
124 return '"""%s"""' % s1
125
126
127 -def get_all_text_(node):
128 if node.text is not None:
129 text = node.text
130 else:
131 text = ''
132 for child in node:
133 if child.tail is not None:
134 text += child.tail
135 return text
136
137
140
142 if XMLParser_import_library == XMLParser_import_lxml:
143 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
144 else:
145 msg = '%s (element %s)' % (msg, node.tag, )
146 raise GDSParseError(msg)
147
148
150
151 CategoryNone = 0
152 CategoryText = 1
153 CategorySimple = 2
154 CategoryComplex = 3
155
156 TypeNone = 0
157 TypeText = 1
158 TypeString = 2
159 TypeInteger = 3
160 TypeFloat = 4
161 TypeDecimal = 5
162 TypeDouble = 6
163 TypeBoolean = 7
164 - def __init__(self, category, content_type, name, value):
165 self.category = category
166 self.content_type = content_type
167 self.name = name
168 self.value = value
171 - def getContenttype(self, content_type):
172 return self.content_type
177 - def export(self, outfile, level, name, namespace):
198 if self.category == MixedContainer.CategoryText:
199 showIndent(outfile, level)
200 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
201 (self.category, self.content_type, self.name, self.value))
202 elif self.category == MixedContainer.CategorySimple:
203 showIndent(outfile, level)
204 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
205 (self.category, self.content_type, self.name, self.value))
206 else:
207 showIndent(outfile, level)
208 outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \
209 (self.category, self.content_type, self.name,))
210 self.value.exportLiteral(outfile, level + 1)
211 showIndent(outfile, level)
212 outfile.write(')\n')
213
214
216 - def __init__(self, name='', data_type='', container=0):
217 self.name = name
218 self.data_type = data_type
219 self.container = container
220 - def set_name(self, name): self.name = name
225 if isinstance(self.data_type, list):
226 if len(self.data_type) > 0:
227 return self.data_type[-1]
228 else:
229 return 'xs:string'
230 else:
231 return self.data_type
234
236 if typ is None or value is None:
237 return value
238 return typ(value)
239
240
241
242
243
245 """A <siteCode> is an identifier that this site is referred to
246 as. This Code used by organization that collects the data to
247 identify the site. A siteCode has a reference to it's source or
248 network as the @network. For waterWebServices, a site/location
249 is the network plus the value of the sitecode, eg
250 '@network:siteCode' siteCode identifiers often change, so
251 multiple siteCode elements are allowed There may be multiple
252 siteCode elements. Only one should be labeled as the default
253 using @defaultID (set attribute defaultID=true) Multiple
254 siteCode elements can utilize different observation networks may
255 refer to the same site with different identifiers. True if this
256 is the main identifier that this service uses to access this
257 site. default value is false. The abbreviation for the
258 datasource or observation network that this site code is
259 associated with. A siteCode has a reference to it's source or
260 network as the @network. For waterWebServices, a site/location
261 is the network plus the value of the sitecode, eg
262 '@network:siteCode'An internal numeric identifier of the site.
263 Code used to differentiate sites in a datasource. Agency codes
264 are specific to a data source, and are not required nor do they
265 need to be understood by a web service client.optional name to
266 provide more detail about an agency code"""
267 subclass = None
268 superclass = None
269 - def __init__(self, agencyCode=None, defaultId=None, siteID=None, network=None, agencyName=None, valueOf_=None):
270 self.agencyCode = _cast(None, agencyCode)
271 self.defaultId = _cast(bool, defaultId)
272 self.siteID = _cast(None, siteID)
273 self.network = _cast(None, network)
274 self.agencyName = _cast(None, agencyName)
275 self.valueOf_ = valueOf_
281 factory = staticmethod(factory)
287 - def set_siteID(self, siteID): self.siteID = siteID
294 - def export(self, outfile, level, namespace_='', name_='siteCode', namespacedef_=''):
295 showIndent(outfile, level)
296 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
297 self.exportAttributes(outfile, level, [], namespace_, name_='siteCode')
298 if self.hasContent_():
299 outfile.write('>')
300 outfile.write(self.valueOf_)
301 self.exportChildren(outfile, level + 1, namespace_, name_)
302 outfile.write('</%s%s>\n' % (namespace_, name_))
303 else:
304 outfile.write('/>\n')
305 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='siteCode'):
306 if self.agencyCode is not None and 'agencyCode' not in already_processed:
307 already_processed.append('agencyCode')
308 outfile.write(' agencyCode=%s' % (self.gds_format_string(quote_attrib(self.agencyCode).encode(ExternalEncoding), input_name='agencyCode'), ))
309 if self.defaultId is not None and 'defaultId' not in already_processed:
310 already_processed.append('defaultId')
311 outfile.write(' defaultId="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.defaultId)), input_name='defaultId'))
312 if self.siteID is not None and 'siteID' not in already_processed:
313 already_processed.append('siteID')
314 outfile.write(' siteID=%s' % (self.gds_format_string(quote_attrib(self.siteID).encode(ExternalEncoding), input_name='siteID'), ))
315 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), ))
316 if self.agencyName is not None and 'agencyName' not in already_processed:
317 already_processed.append('agencyName')
318 outfile.write(' agencyName=%s' % (self.gds_format_string(quote_attrib(self.agencyName).encode(ExternalEncoding), input_name='agencyName'), ))
319 - def exportChildren(self, outfile, level, namespace_='', name_='siteCode'):
321 - def hasContent_(self):
322 if (
323 self.valueOf_
324 ):
325 return True
326 else:
327 return False
336 if self.agencyCode is not None and 'agencyCode' not in already_processed:
337 already_processed.append('agencyCode')
338 showIndent(outfile, level)
339 outfile.write('agencyCode = "%s",\n' % (self.agencyCode,))
340 if self.defaultId is not None and 'defaultId' not in already_processed:
341 already_processed.append('defaultId')
342 showIndent(outfile, level)
343 outfile.write('defaultId = %s,\n' % (self.defaultId,))
344 if self.siteID is not None and 'siteID' not in already_processed:
345 already_processed.append('siteID')
346 showIndent(outfile, level)
347 outfile.write('siteID = "%s",\n' % (self.siteID,))
348 if self.network is not None and 'network' not in already_processed:
349 already_processed.append('network')
350 showIndent(outfile, level)
351 outfile.write('network = "%s",\n' % (self.network,))
352 if self.agencyName is not None and 'agencyName' not in already_processed:
353 already_processed.append('agencyName')
354 showIndent(outfile, level)
355 outfile.write('agencyName = "%s",\n' % (self.agencyName,))
365 value = attrs.get('agencyCode')
366 if value is not None and 'agencyCode' not in already_processed:
367 already_processed.append('agencyCode')
368 self.agencyCode = value
369 value = attrs.get('defaultId')
370 if value is not None and 'defaultId' not in already_processed:
371 already_processed.append('defaultId')
372 if value in ('true', '1'):
373 self.defaultId = True
374 elif value in ('false', '0'):
375 self.defaultId = False
376 else:
377 raise_parse_error(node, 'Bad boolean attribute')
378 value = attrs.get('siteID')
379 if value is not None and 'siteID' not in already_processed:
380 already_processed.append('siteID')
381 self.siteID = value
382 value = attrs.get('network')
383 if value is not None and 'network' not in already_processed:
384 already_processed.append('network')
385 self.network = value
386 value = attrs.get('agencyName')
387 if value is not None and 'agencyName' not in already_processed:
388 already_processed.append('agencyName')
389 self.agencyName = value
390 - def buildChildren(self, child_, nodeName_, from_subclass=False):
392
393
394
396 """The geoLocation speficies the details of the geographic location. It
397 contains two portions, a geographic locaiton
398 &lt;geogLocation&gt;, and a local location
399 &lt;localSiteXY&gt;. In order to be discovered
400 spatially, geogLocation is required. The geogLocation can be of
401 GeogLocationType, which at present is either a latLonPoint or a
402 latLongBox. There may be multiple localSiteXY, which might be
403 used by data sources to provide other coordinated system
404 information, like UTM and State Plane coordinates."""
405 subclass = None
406 superclass = None
407 - def __init__(self, geogLocation=None, localSiteXY=None):
418 factory = staticmethod(factory)
425 - def export(self, outfile, level, namespace_='', name_='geoLocation', namespacedef_=''):
426 showIndent(outfile, level)
427 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
428 self.exportAttributes(outfile, level, [], namespace_, name_='geoLocation')
429 if self.hasContent_():
430 outfile.write('>\n')
431 self.exportChildren(outfile, level + 1, namespace_, name_)
432 showIndent(outfile, level)
433 outfile.write('</%s%s>\n' % (namespace_, name_))
434 else:
435 outfile.write('/>\n')
436 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='geoLocation'):
438 - def exportChildren(self, outfile, level, namespace_='', name_='geoLocation'):
439 if self.geogLocation:
440 self.geogLocation.export(outfile, level, namespace_, name_='geogLocation', )
441 for localSiteXY_ in self.localSiteXY:
442 localSiteXY_.export(outfile, level, namespace_, name_='localSiteXY')
443 - def hasContent_(self):
444 if (
445 self.geogLocation is not None or
446 self.localSiteXY
447 ):
448 return True
449 else:
450 return False
459 if self.geogLocation is not None:
460 showIndent(outfile, level)
461 outfile.write('geogLocation=model_.GeogLocationType(\n')
462 self.geogLocation.exportLiteral(outfile, level, name_='geogLocation')
463 showIndent(outfile, level)
464 outfile.write('),\n')
465 showIndent(outfile, level)
466 outfile.write('localSiteXY=[\n')
467 level += 1
468 for localSiteXY_ in self.localSiteXY:
469 showIndent(outfile, level)
470 outfile.write('model_.localSiteXY(\n')
471 localSiteXY_.exportLiteral(outfile, level)
472 showIndent(outfile, level)
473 outfile.write('),\n')
474 level -= 1
475 showIndent(outfile, level)
476 outfile.write('],\n')
484 - def buildChildren(self, child_, nodeName_, from_subclass=False):
493
494
495
497 """Site information can contain one or more other locations using the
498 localSiteXY element. The projection string should be stored in
499 projectionInformation. Lat or Northing = Y Lon or Easting = X
500 Spatial Reference System of the local coordinates. This should
501 use the PROJ4 projection string standard"""
502 subclass = None
503 superclass = None
504 - def __init__(self, projectionInformation=None, X=None, Y=None, Z=None, note=None):
505 self.projectionInformation = _cast(None, projectionInformation)
506 self.X = X
507 self.Y = Y
508 self.Z = Z
509 if note is None:
510 self.note = []
511 else:
512 self.note = note
518 factory = staticmethod(factory)
519 - def get_X(self): return self.X
520 - def set_X(self, X): self.X = X
521 - def get_Y(self): return self.Y
522 - def set_Y(self, Y): self.Y = Y
523 - def get_Z(self): return self.Z
524 - def set_Z(self, Z): self.Z = Z
526 - def set_note(self, note): self.note = note
527 - def add_note(self, value): self.note.append(value)
531 - def export(self, outfile, level, namespace_='', name_='localSiteXY', namespacedef_=''):
532 showIndent(outfile, level)
533 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
534 self.exportAttributes(outfile, level, [], namespace_, name_='localSiteXY')
535 if self.hasContent_():
536 outfile.write('>\n')
537 self.exportChildren(outfile, level + 1, namespace_, name_)
538 showIndent(outfile, level)
539 outfile.write('</%s%s>\n' % (namespace_, name_))
540 else:
541 outfile.write('/>\n')
542 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='localSiteXY'):
543 if self.projectionInformation is not None and 'projectionInformation' not in already_processed:
544 already_processed.append('projectionInformation')
545 outfile.write(' projectionInformation=%s' % (self.gds_format_string(quote_attrib(self.projectionInformation).encode(ExternalEncoding), input_name='projectionInformation'), ))
546 - def exportChildren(self, outfile, level, namespace_='', name_='localSiteXY'):
547 if self.X is not None:
548 showIndent(outfile, level)
549 outfile.write('<%sX>%s</%sX>\n' % (namespace_, self.gds_format_string(quote_xml(self.X).encode(ExternalEncoding), input_name='X'), namespace_))
550 if self.Y is not None:
551 showIndent(outfile, level)
552 outfile.write('<%sY>%s</%sY>\n' % (namespace_, self.gds_format_string(quote_xml(self.Y).encode(ExternalEncoding), input_name='Y'), namespace_))
553 if self.Z is not None:
554 showIndent(outfile, level)
555 outfile.write('<%sZ>%s</%sZ>\n' % (namespace_, self.gds_format_string(quote_xml(self.Z).encode(ExternalEncoding), input_name='Z'), namespace_))
556 for note_ in self.note:
557 note_.export(outfile, level, namespace_, name_='note')
558 - def hasContent_(self):
559 if (
560 self.X is not None or
561 self.Y is not None or
562 self.Z is not None or
563 self.note
564 ):
565 return True
566 else:
567 return False
574 if self.projectionInformation is not None and 'projectionInformation' not in already_processed:
575 already_processed.append('projectionInformation')
576 showIndent(outfile, level)
577 outfile.write('projectionInformation = "%s",\n' % (self.projectionInformation,))
579 if self.X is not None:
580 showIndent(outfile, level)
581 outfile.write('X=%s,\n' % quote_python(self.X).encode(ExternalEncoding))
582 if self.Y is not None:
583 showIndent(outfile, level)
584 outfile.write('Y=%s,\n' % quote_python(self.Y).encode(ExternalEncoding))
585 if self.Z is not None:
586 showIndent(outfile, level)
587 outfile.write('Z=%s,\n' % quote_python(self.Z).encode(ExternalEncoding))
588 showIndent(outfile, level)
589 outfile.write('note=[\n')
590 level += 1
591 for note_ in self.note:
592 showIndent(outfile, level)
593 outfile.write('model_.NoteType(\n')
594 note_.exportLiteral(outfile, level, name_='NoteType')
595 showIndent(outfile, level)
596 outfile.write('),\n')
597 level -= 1
598 showIndent(outfile, level)
599 outfile.write('],\n')
606 value = attrs.get('projectionInformation')
607 if value is not None and 'projectionInformation' not in already_processed:
608 already_processed.append('projectionInformation')
609 self.projectionInformation = value
610 - def buildChildren(self, child_, nodeName_, from_subclass=False):
611 if nodeName_ == 'X':
612 X_ = child_.text
613 self.X = X_
614 elif nodeName_ == 'Y':
615 Y_ = child_.text
616 self.Y = Y_
617 elif nodeName_ == 'Z':
618 Z_ = child_.text
619 self.Z = Z_
620 elif nodeName_ == 'note':
621 obj_ = NoteType.factory()
622 obj_.build(child_)
623 self.note.append(obj_)
624
625
626
628 """TsValuesSingleVariableTypea aggregates the list of values and
629 associated metadata. It is the values element in the
630 timeSereisResponse Attributes are optional, but use @count is
631 encouraged. The atrributes @unitsAreConverted,
632 @untsCode,@unitsAbbreviation, and @unitsType were originally
633 included to allow for translation from orignal variable units.
634 Thier use is not encouraged. Get unit information from the
635 Variable element.If a webservice has transformed the time zone
636 from the original data.the measurment units of the value
637 elements in this values element True if a webservice has
638 transformed the data from the original units."""
639 subclass = None
640 superclass = None
641 - def __init__(self, count=None, unitsAbbreviation=None, unitsType=None, timeZoneShiftApplied=None, unitsAreConverted=False, unitsCode=None, value=None, qualifier=None, qualityControlLevel=None, method=None, source=None, offset=None):
642 self.count = _cast(int, count)
643 self.unitsAbbreviation = _cast(None, unitsAbbreviation)
644 self.unitsType = _cast(None, unitsType)
645 self.timeZoneShiftApplied = _cast(bool, timeZoneShiftApplied)
646 self.unitsAreConverted = _cast(bool, unitsAreConverted)
647 self.unitsCode = _cast(None, unitsCode)
648 if value is None:
649 self.value = []
650 else:
651 self.value = value
652 if qualifier is None:
653 self.qualifier = []
654 else:
655 self.qualifier = qualifier
656 if qualityControlLevel is None:
657 self.qualityControlLevel = []
658 else:
659 self.qualityControlLevel = qualityControlLevel
660 if method is None:
661 self.method = []
662 else:
663 self.method = method
664 if source is None:
665 self.source = []
666 else:
667 self.source = source
668 if offset is None:
669 self.offset = []
670 else:
671 self.offset = offset
677 factory = staticmethod(factory)
679 - def set_value(self, value): self.value = value
680 - def add_value(self, value): self.value.append(value)
691 - def set_method(self, method): self.method = method
692 - def add_method(self, value): self.method.append(value)
695 - def set_source(self, source): self.source = source
696 - def add_source(self, value): self.source.append(value)
699 - def set_offset(self, offset): self.offset = offset
700 - def add_offset(self, value): self.offset.append(value)
703 - def set_count(self, count): self.count = count
717 - def export(self, outfile, level, namespace_='', name_='TsValuesSingleVariableType', namespacedef_=''):
718 showIndent(outfile, level)
719 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
720 self.exportAttributes(outfile, level, [], namespace_, name_='TsValuesSingleVariableType')
721 if self.hasContent_():
722 outfile.write('>\n')
723 self.exportChildren(outfile, level + 1, namespace_, name_)
724 showIndent(outfile, level)
725 outfile.write('</%s%s>\n' % (namespace_, name_))
726 else:
727 outfile.write('/>\n')
728 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TsValuesSingleVariableType'):
729 if self.count is not None and 'count' not in already_processed:
730 already_processed.append('count')
731 outfile.write(' count="%s"' % self.gds_format_integer(self.count, input_name='count'))
732 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed:
733 already_processed.append('unitsAbbreviation')
734 outfile.write(' unitsAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.unitsAbbreviation).encode(ExternalEncoding), input_name='unitsAbbreviation'), ))
735 if self.unitsType is not None and 'unitsType' not in already_processed:
736 already_processed.append('unitsType')
737 outfile.write(' unitsType=%s' % (quote_attrib(self.unitsType), ))
738 if self.timeZoneShiftApplied is not None and 'timeZoneShiftApplied' not in already_processed:
739 already_processed.append('timeZoneShiftApplied')
740 outfile.write(' timeZoneShiftApplied="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.timeZoneShiftApplied)), input_name='timeZoneShiftApplied'))
741 if self.unitsAreConverted is not None and 'unitsAreConverted' not in already_processed:
742 already_processed.append('unitsAreConverted')
743 outfile.write(' unitsAreConverted="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.unitsAreConverted)), input_name='unitsAreConverted'))
744 if self.unitsCode is not None and 'unitsCode' not in already_processed:
745 already_processed.append('unitsCode')
746 outfile.write(' unitsCode=%s' % (self.gds_format_string(quote_attrib(self.unitsCode).encode(ExternalEncoding), input_name='unitsCode'), ))
747 - def exportChildren(self, outfile, level, namespace_='', name_='TsValuesSingleVariableType'):
748 for value_ in self.value:
749 value_.export(outfile, level, namespace_, name_='value')
750 for qualifier_ in self.qualifier:
751 qualifier_.export(outfile, level, namespace_, name_='qualifier')
752 for qualityControlLevel_ in self.qualityControlLevel:
753 qualityControlLevel_.export(outfile, level, namespace_, name_='qualityControlLevel')
754 for method_ in self.method:
755 method_.export(outfile, level, namespace_, name_='method')
756 for source_ in self.source:
757 source_.export(outfile, level, namespace_, name_='source')
758 for offset_ in self.offset:
759 offset_.export(outfile, level, namespace_, name_='offset')
760 - def hasContent_(self):
761 if (
762 self.value or
763 self.qualifier or
764 self.qualityControlLevel or
765 self.method or
766 self.source or
767 self.offset
768 ):
769 return True
770 else:
771 return False
772 - def exportLiteral(self, outfile, level, name_='TsValuesSingleVariableType'):
778 if self.count is not None and 'count' not in already_processed:
779 already_processed.append('count')
780 showIndent(outfile, level)
781 outfile.write('count = %d,\n' % (self.count,))
782 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed:
783 already_processed.append('unitsAbbreviation')
784 showIndent(outfile, level)
785 outfile.write('unitsAbbreviation = "%s",\n' % (self.unitsAbbreviation,))
786 if self.unitsType is not None and 'unitsType' not in already_processed:
787 already_processed.append('unitsType')
788 showIndent(outfile, level)
789 outfile.write('unitsType = "%s",\n' % (self.unitsType,))
790 if self.timeZoneShiftApplied is not None and 'timeZoneShiftApplied' not in already_processed:
791 already_processed.append('timeZoneShiftApplied')
792 showIndent(outfile, level)
793 outfile.write('timeZoneShiftApplied = %s,\n' % (self.timeZoneShiftApplied,))
794 if self.unitsAreConverted is not None and 'unitsAreConverted' not in already_processed:
795 already_processed.append('unitsAreConverted')
796 showIndent(outfile, level)
797 outfile.write('unitsAreConverted = %s,\n' % (self.unitsAreConverted,))
798 if self.unitsCode is not None and 'unitsCode' not in already_processed:
799 already_processed.append('unitsCode')
800 showIndent(outfile, level)
801 outfile.write('unitsCode = "%s",\n' % (self.unitsCode,))
803 showIndent(outfile, level)
804 outfile.write('value=[\n')
805 level += 1
806 for value_ in self.value:
807 showIndent(outfile, level)
808 outfile.write('model_.ValueSingleVariable(\n')
809 value_.exportLiteral(outfile, level, name_='ValueSingleVariable')
810 showIndent(outfile, level)
811 outfile.write('),\n')
812 level -= 1
813 showIndent(outfile, level)
814 outfile.write('],\n')
815 showIndent(outfile, level)
816 outfile.write('qualifier=[\n')
817 level += 1
818 for qualifier_ in self.qualifier:
819 showIndent(outfile, level)
820 outfile.write('model_.qualifier(\n')
821 qualifier_.exportLiteral(outfile, level)
822 showIndent(outfile, level)
823 outfile.write('),\n')
824 level -= 1
825 showIndent(outfile, level)
826 outfile.write('],\n')
827 showIndent(outfile, level)
828 outfile.write('qualityControlLevel=[\n')
829 level += 1
830 for qualityControlLevel_ in self.qualityControlLevel:
831 showIndent(outfile, level)
832 outfile.write('model_.qualityControlLevel(\n')
833 qualityControlLevel_.exportLiteral(outfile, level)
834 showIndent(outfile, level)
835 outfile.write('),\n')
836 level -= 1
837 showIndent(outfile, level)
838 outfile.write('],\n')
839 showIndent(outfile, level)
840 outfile.write('method=[\n')
841 level += 1
842 for method_ in self.method:
843 showIndent(outfile, level)
844 outfile.write('model_.MethodType(\n')
845 method_.exportLiteral(outfile, level, name_='MethodType')
846 showIndent(outfile, level)
847 outfile.write('),\n')
848 level -= 1
849 showIndent(outfile, level)
850 outfile.write('],\n')
851 showIndent(outfile, level)
852 outfile.write('source=[\n')
853 level += 1
854 for source_ in self.source:
855 showIndent(outfile, level)
856 outfile.write('model_.SourceType(\n')
857 source_.exportLiteral(outfile, level, name_='SourceType')
858 showIndent(outfile, level)
859 outfile.write('),\n')
860 level -= 1
861 showIndent(outfile, level)
862 outfile.write('],\n')
863 showIndent(outfile, level)
864 outfile.write('offset=[\n')
865 level += 1
866 for offset_ in self.offset:
867 showIndent(outfile, level)
868 outfile.write('model_.OffsetType(\n')
869 offset_.exportLiteral(outfile, level, name_='OffsetType')
870 showIndent(outfile, level)
871 outfile.write('),\n')
872 level -= 1
873 showIndent(outfile, level)
874 outfile.write('],\n')
881 value = attrs.get('count')
882 if value is not None and 'count' not in already_processed:
883 already_processed.append('count')
884 try:
885 self.count = int(value)
886 except ValueError, exp:
887 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
888 if self.count < 0:
889 raise_parse_error(node, 'Invalid NonNegativeInteger')
890 value = attrs.get('unitsAbbreviation')
891 if value is not None and 'unitsAbbreviation' not in already_processed:
892 already_processed.append('unitsAbbreviation')
893 self.unitsAbbreviation = value
894 value = attrs.get('unitsType')
895 if value is not None and 'unitsType' not in already_processed:
896 already_processed.append('unitsType')
897 self.unitsType = value
898 value = attrs.get('timeZoneShiftApplied')
899 if value is not None and 'timeZoneShiftApplied' not in already_processed:
900 already_processed.append('timeZoneShiftApplied')
901 if value in ('true', '1'):
902 self.timeZoneShiftApplied = True
903 elif value in ('false', '0'):
904 self.timeZoneShiftApplied = False
905 else:
906 raise_parse_error(node, 'Bad boolean attribute')
907 value = attrs.get('unitsAreConverted')
908 if value is not None and 'unitsAreConverted' not in already_processed:
909 already_processed.append('unitsAreConverted')
910 if value in ('true', '1'):
911 self.unitsAreConverted = True
912 elif value in ('false', '0'):
913 self.unitsAreConverted = False
914 else:
915 raise_parse_error(node, 'Bad boolean attribute')
916 value = attrs.get('unitsCode')
917 if value is not None and 'unitsCode' not in already_processed:
918 already_processed.append('unitsCode')
919 self.unitsCode = value
920 self.unitsCode = ' '.join(self.unitsCode.split())
921 - def buildChildren(self, child_, nodeName_, from_subclass=False):
946
947
948
950 """VariableInfoType is a complex type containting full descriptive
951 information about a variable, as described by the ODM. This
952 includes one or more variable codes, the short variable name, a
953 detailed variable description, and suggest It also extends the
954 ODM model, in several methods: - options contain extended
955 reuqest information. - note(s) are for generic extension. -
956 extension is an element where additional namespace information
957 should be placed. - related allows for parent and child
958 relationships between variables to be communicated."""
959 subclass = None
960 superclass = None
961 - def __init__(self, metadataDateTime=None, oid=None, variableCode=None, variableName=None, variableDescription=None, valueType=None, dataType=None, generalCategory=None, sampleMedium=None, units=None, options=None, note=None, related=None, extension=None, NoDataValue=None, timeSupport=None):
989 factory = staticmethod(factory)
1004 - def set_dataType(self, dataType): self.dataType = dataType
1023 - def set_note(self, note): self.note = note
1024 - def add_note(self, value): self.note.append(value)
1036 - def get_oid(self): return self.oid
1037 - def set_oid(self, oid): self.oid = oid
1038 - def export(self, outfile, level, namespace_='', name_='VariableInfoType', namespacedef_=''):
1039 showIndent(outfile, level)
1040 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1041 self.exportAttributes(outfile, level, [], namespace_, name_='VariableInfoType')
1042 if self.hasContent_():
1043 outfile.write('>\n')
1044 self.exportChildren(outfile, level + 1, namespace_, name_)
1045 showIndent(outfile, level)
1046 outfile.write('</%s%s>\n' % (namespace_, name_))
1047 else:
1048 outfile.write('/>\n')
1049 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='VariableInfoType'):
1050 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
1051 already_processed.append('metadataDateTime')
1052 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), ))
1053 if self.oid is not None and 'oid' not in already_processed:
1054 already_processed.append('oid')
1055 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), ))
1056 - def exportChildren(self, outfile, level, namespace_='', name_='VariableInfoType'):
1057 for variableCode_ in self.variableCode:
1058 variableCode_.export(outfile, level, namespace_, name_='variableCode')
1059 if self.variableName is not None:
1060 showIndent(outfile, level)
1061 outfile.write('<%svariableName>%s</%svariableName>\n' % (namespace_, self.gds_format_string(quote_xml(self.variableName).encode(ExternalEncoding), input_name='variableName'), namespace_))
1062 if self.variableDescription is not None:
1063 showIndent(outfile, level)
1064 outfile.write('<%svariableDescription>%s</%svariableDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.variableDescription).encode(ExternalEncoding), input_name='variableDescription'), namespace_))
1065 if self.valueType is not None:
1066 showIndent(outfile, level)
1067 outfile.write('<%svalueType>%s</%svalueType>\n' % (namespace_, self.gds_format_string(quote_xml(self.valueType).encode(ExternalEncoding), input_name='valueType'), namespace_))
1068 if self.dataType is not None:
1069 showIndent(outfile, level)
1070 outfile.write('<%sdataType>%s</%sdataType>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataType).encode(ExternalEncoding), input_name='dataType'), namespace_))
1071 if self.generalCategory is not None:
1072 showIndent(outfile, level)
1073 outfile.write('<%sgeneralCategory>%s</%sgeneralCategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.generalCategory).encode(ExternalEncoding), input_name='generalCategory'), namespace_))
1074 if self.sampleMedium is not None:
1075 showIndent(outfile, level)
1076 outfile.write('<%ssampleMedium>%s</%ssampleMedium>\n' % (namespace_, self.gds_format_string(quote_xml(self.sampleMedium).encode(ExternalEncoding), input_name='sampleMedium'), namespace_))
1077 if self.units:
1078 self.units.export(outfile, level, namespace_, name_='units')
1079 if self.options:
1080 self.options.export(outfile, level, namespace_, name_='options')
1081 for note_ in self.note:
1082 note_.export(outfile, level, namespace_, name_='note')
1083 if self.related:
1084 self.related.export(outfile, level, namespace_, name_='related')
1085 if self.extension is not None:
1086 showIndent(outfile, level)
1087 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
1088 if self.NoDataValue is not None:
1089 showIndent(outfile, level)
1090 outfile.write('<%sNoDataValue>%s</%sNoDataValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.NoDataValue).encode(ExternalEncoding), input_name='NoDataValue'), namespace_))
1091 if self.timeSupport:
1092 self.timeSupport.export(outfile, level, namespace_, name_='timeSupport')
1093 - def hasContent_(self):
1094 if (
1095 self.variableCode or
1096 self.variableName is not None or
1097 self.variableDescription is not None or
1098 self.valueType is not None or
1099 self.dataType is not None or
1100 self.generalCategory is not None or
1101 self.sampleMedium is not None or
1102 self.units is not None or
1103 self.options is not None or
1104 self.note or
1105 self.related is not None or
1106 self.extension is not None or
1107 self.NoDataValue is not None or
1108 self.timeSupport is not None
1109 ):
1110 return True
1111 else:
1112 return False
1113 - def exportLiteral(self, outfile, level, name_='VariableInfoType'):
1119 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
1120 already_processed.append('metadataDateTime')
1121 showIndent(outfile, level)
1122 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,))
1123 if self.oid is not None and 'oid' not in already_processed:
1124 already_processed.append('oid')
1125 showIndent(outfile, level)
1126 outfile.write('oid = "%s",\n' % (self.oid,))
1128 showIndent(outfile, level)
1129 outfile.write('variableCode=[\n')
1130 level += 1
1131 for variableCode_ in self.variableCode:
1132 showIndent(outfile, level)
1133 outfile.write('model_.variableCode(\n')
1134 variableCode_.exportLiteral(outfile, level)
1135 showIndent(outfile, level)
1136 outfile.write('),\n')
1137 level -= 1
1138 showIndent(outfile, level)
1139 outfile.write('],\n')
1140 if self.variableName is not None:
1141 showIndent(outfile, level)
1142 outfile.write('variableName=%s,\n' % quote_python(self.variableName).encode(ExternalEncoding))
1143 if self.variableDescription is not None:
1144 showIndent(outfile, level)
1145 outfile.write('variableDescription=%s,\n' % quote_python(self.variableDescription).encode(ExternalEncoding))
1146 if self.valueType is not None:
1147 showIndent(outfile, level)
1148 outfile.write('valueType=%s,\n' % quote_python(self.valueType).encode(ExternalEncoding))
1149 if self.dataType is not None:
1150 showIndent(outfile, level)
1151 outfile.write('dataType=%s,\n' % quote_python(self.dataType).encode(ExternalEncoding))
1152 if self.generalCategory is not None:
1153 showIndent(outfile, level)
1154 outfile.write('generalCategory=%s,\n' % quote_python(self.generalCategory).encode(ExternalEncoding))
1155 if self.sampleMedium is not None:
1156 showIndent(outfile, level)
1157 outfile.write('sampleMedium=%s,\n' % quote_python(self.sampleMedium).encode(ExternalEncoding))
1158 if self.units is not None:
1159 showIndent(outfile, level)
1160 outfile.write('units=model_.units(\n')
1161 self.units.exportLiteral(outfile, level)
1162 showIndent(outfile, level)
1163 outfile.write('),\n')
1164 if self.options is not None:
1165 showIndent(outfile, level)
1166 outfile.write('options=model_.options(\n')
1167 self.options.exportLiteral(outfile, level)
1168 showIndent(outfile, level)
1169 outfile.write('),\n')
1170 showIndent(outfile, level)
1171 outfile.write('note=[\n')
1172 level += 1
1173 for note_ in self.note:
1174 showIndent(outfile, level)
1175 outfile.write('model_.NoteType(\n')
1176 note_.exportLiteral(outfile, level, name_='NoteType')
1177 showIndent(outfile, level)
1178 outfile.write('),\n')
1179 level -= 1
1180 showIndent(outfile, level)
1181 outfile.write('],\n')
1182 if self.related is not None:
1183 showIndent(outfile, level)
1184 outfile.write('related=model_.related(\n')
1185 self.related.exportLiteral(outfile, level)
1186 showIndent(outfile, level)
1187 outfile.write('),\n')
1188 if self.extension is not None:
1189 showIndent(outfile, level)
1190 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
1191 if self.NoDataValue is not None:
1192 showIndent(outfile, level)
1193 outfile.write('NoDataValue=%s,\n' % quote_python(self.NoDataValue).encode(ExternalEncoding))
1194 if self.timeSupport is not None:
1195 showIndent(outfile, level)
1196 outfile.write('timeSupport=model_.timeSupport(\n')
1197 self.timeSupport.exportLiteral(outfile, level)
1198 showIndent(outfile, level)
1199 outfile.write('),\n')
1206 value = attrs.get('metadataDateTime')
1207 if value is not None and 'metadataDateTime' not in already_processed:
1208 already_processed.append('metadataDateTime')
1209 self.metadataDateTime = value
1210 value = attrs.get('oid')
1211 if value is not None and 'oid' not in already_processed:
1212 already_processed.append('oid')
1213 self.oid = value
1214 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1215 if nodeName_ == 'variableCode':
1216 obj_ = variableCode.factory()
1217 obj_.build(child_)
1218 self.variableCode.append(obj_)
1219 elif nodeName_ == 'variableName':
1220 variableName_ = child_.text
1221 self.variableName = variableName_
1222 elif nodeName_ == 'variableDescription':
1223 variableDescription_ = child_.text
1224 self.variableDescription = variableDescription_
1225 elif nodeName_ == 'valueType':
1226 valueType_ = child_.text
1227 self.valueType = valueType_
1228 self.validate_valueType(self.valueType)
1229 elif nodeName_ == 'dataType':
1230 dataType_ = child_.text
1231 self.dataType = dataType_
1232 self.validate_dataType(self.dataType)
1233 elif nodeName_ == 'generalCategory':
1234 generalCategory_ = child_.text
1235 self.generalCategory = generalCategory_
1236 self.validate_generalCategory(self.generalCategory)
1237 elif nodeName_ == 'sampleMedium':
1238 sampleMedium_ = child_.text
1239 self.sampleMedium = sampleMedium_
1240 self.validate_sampleMedium(self.sampleMedium)
1241 elif nodeName_ == 'units':
1242 obj_ = units.factory()
1243 obj_.build(child_)
1244 self.set_units(obj_)
1245 elif nodeName_ == 'options':
1246 obj_ = options.factory()
1247 obj_.build(child_)
1248 self.set_options(obj_)
1249 elif nodeName_ == 'note':
1250 obj_ = NoteType.factory()
1251 obj_.build(child_)
1252 self.note.append(obj_)
1253 elif nodeName_ == 'related':
1254 obj_ = related.factory()
1255 obj_.build(child_)
1256 self.set_related(obj_)
1257 elif nodeName_ == 'extension':
1258 extension_ = child_.text
1259 self.extension = extension_
1260 elif nodeName_ == 'NoDataValue':
1261 NoDataValue_ = child_.text
1262 self.NoDataValue = NoDataValue_
1263 elif nodeName_ == 'timeSupport':
1264 obj_ = timeSupport.factory()
1265 obj_.build(child_)
1266 self.set_timeSupport(obj_)
1267
1268
1269
1345
1346
1347
1349 """variableCode for the parent"""
1350 subclass = None
1351 superclass = None
1352 - def __init__(self, default=None, network=None, vocabulary=None, valueOf_=None):
1362 factory = staticmethod(factory)
1364 - def set_default(self, default): self.default = default
1370 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
1371 - def export(self, outfile, level, namespace_='', name_='parentID', namespacedef_=''):
1372 showIndent(outfile, level)
1373 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1374 self.exportAttributes(outfile, level, [], namespace_, name_='parentID')
1375 if self.hasContent_():
1376 outfile.write('>')
1377 outfile.write(self.valueOf_)
1378 self.exportChildren(outfile, level + 1, namespace_, name_)
1379 outfile.write('</%s%s>\n' % (namespace_, name_))
1380 else:
1381 outfile.write('/>\n')
1382 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='parentID'):
1392 - def exportChildren(self, outfile, level, namespace_='', name_='parentID'):
1394 - def hasContent_(self):
1395 if (
1396 self.valueOf_
1397 ):
1398 return True
1399 else:
1400 return False
1409 if self.default is not None and 'default' not in already_processed:
1410 already_processed.append('default')
1411 showIndent(outfile, level)
1412 outfile.write('default = %s,\n' % (self.default,))
1413 if self.network is not None and 'network' not in already_processed:
1414 already_processed.append('network')
1415 showIndent(outfile, level)
1416 outfile.write('network = "%s",\n' % (self.network,))
1417 if self.vocabulary is not None and 'vocabulary' not in already_processed:
1418 already_processed.append('vocabulary')
1419 showIndent(outfile, level)
1420 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
1430 value = attrs.get('default')
1431 if value is not None and 'default' not in already_processed:
1432 already_processed.append('default')
1433 if value in ('true', '1'):
1434 self.default = True
1435 elif value in ('false', '0'):
1436 self.default = False
1437 else:
1438 raise_parse_error(node, 'Bad boolean attribute')
1439 value = attrs.get('network')
1440 if value is not None and 'network' not in already_processed:
1441 already_processed.append('network')
1442 self.network = value
1443 value = attrs.get('vocabulary')
1444 if value is not None and 'vocabulary' not in already_processed:
1445 already_processed.append('vocabulary')
1446 self.vocabulary = value
1447 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1449
1450
1451
1554
1555
1556
1558 """Element containing the time support (or temporal footprint) of the
1559 data values. @isRegular indicates if the spacing is regular. In
1560 waterML 1.0, there is a divergence of mean between ODM, and
1561 WaterML. WaterML only communcates the regularity, and the
1562 spacing of the observations (timeInterval). Whereas timesupport
1563 in the ODM is associated with the dataType, and time support.
1564 This will be addressed in 1.1 0 is used to indicate data values
1565 that are instantaneous. Other values indicate the time over
1566 which the data values are implicitly or explicitly averaged or
1567 aggregated. The default for the TimeSupport field is 0. This
1568 corresponds to instantaneous values. If the TimeSupport field is
1569 set to a value other than 0, an appropriate TimeUnitsID must be
1570 specified. The TimeUnitsID field can only reference valid
1571 UnitsID values from the Units controlled vocabulary table. If
1572 the TimeSupport field is set to 0, any time units can be used
1573 (i.e., seconds, minutes, hours, etc.), however a default value
1574 of 103 has been used, which corresponds with hours"""
1575 subclass = None
1576 superclass = None
1577 - def __init__(self, isRegular=None, unit=None, timeInterval=None):
1578 self.isRegular = _cast(bool, isRegular)
1579 self.unit = unit
1580 self.timeInterval = timeInterval
1586 factory = staticmethod(factory)
1588 - def set_unit(self, unit): self.unit = unit
1593 - def export(self, outfile, level, namespace_='', name_='timeSupport', namespacedef_=''):
1594 showIndent(outfile, level)
1595 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1596 self.exportAttributes(outfile, level, [], namespace_, name_='timeSupport')
1597 if self.hasContent_():
1598 outfile.write('>\n')
1599 self.exportChildren(outfile, level + 1, namespace_, name_)
1600 showIndent(outfile, level)
1601 outfile.write('</%s%s>\n' % (namespace_, name_))
1602 else:
1603 outfile.write('/>\n')
1604 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeSupport'):
1605 if self.isRegular is not None and 'isRegular' not in already_processed:
1606 already_processed.append('isRegular')
1607 outfile.write(' isRegular="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.isRegular)), input_name='isRegular'))
1608 - def exportChildren(self, outfile, level, namespace_='', name_='timeSupport'):
1609 if self.unit:
1610 self.unit.export(outfile, level, namespace_, name_='unit')
1611
1612 if self.timeInterval is not None:
1613 showIndent(outfile, level)
1614 outfile.write('<%stimeInterval>%s</%stimeInterval>\n' % (namespace_, self.gds_format_string(quote_xml(self.timeInterval).encode(ExternalEncoding), input_name='timeInterval'), namespace_))
1615 - def hasContent_(self):
1616 if (
1617 self.unit is not None or
1618 self.timeInterval is not None
1619 ):
1620 return True
1621 else:
1622 return False
1629 if self.isRegular is not None and 'isRegular' not in already_processed:
1630 already_processed.append('isRegular')
1631 showIndent(outfile, level)
1632 outfile.write('isRegular = %s,\n' % (self.isRegular,))
1634 if self.unit is not None:
1635 showIndent(outfile, level)
1636 outfile.write('unit=model_.UnitsType(\n')
1637 self.unit.exportLiteral(outfile, level, name_='unit')
1638 showIndent(outfile, level)
1639 outfile.write('),\n')
1640 if self.timeInterval is not None:
1641 showIndent(outfile, level)
1642 outfile.write('timeInterval=%s,\n' % quote_python(self.timeInterval).encode(ExternalEncoding))
1649 value = attrs.get('isRegular')
1650 if value is not None and 'isRegular' not in already_processed:
1651 already_processed.append('isRegular')
1652 if value in ('true', '1'):
1653 self.isRegular = True
1654 elif value in ('false', '0'):
1655 self.isRegular = False
1656 else:
1657 raise_parse_error(node, 'Bad boolean attribute')
1658 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1659 if nodeName_ == 'unit':
1660 obj_ = UnitsType.factory()
1661 obj_.build(child_)
1662 self.set_unit(obj_)
1663 elif nodeName_ == 'timeInterval':
1664 timeInterval_ = child_.text
1665 self.timeInterval = timeInterval_
1666
1667
1668
1670 """This contains information about the request, and is used to enable
1671 the XML responses (timeSeriesResponse,
1672 variablesResponse,siteResponse) to be stored on disk."""
1673 subclass = None
1674 superclass = None
1675 - def __init__(self, creationTime=None, queryURL=None, querySQL=None, criteria=None, note=None, extension=None):
1676 self.creationTime = creationTime
1677 self.queryURL = queryURL
1678 self.querySQL = querySQL
1679 self.criteria = criteria
1680 if note is None:
1681 self.note = []
1682 else:
1683 self.note = note
1684 self.extension = extension
1690 factory = staticmethod(factory)
1694 - def set_queryURL(self, queryURL): self.queryURL = queryURL
1696 - def set_querySQL(self, querySQL): self.querySQL = querySQL
1700 - def set_note(self, note): self.note = note
1701 - def add_note(self, value): self.note.append(value)
1705 - def export(self, outfile, level, namespace_='', name_='QueryInfoType', namespacedef_=''):
1706 showIndent(outfile, level)
1707 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1708 self.exportAttributes(outfile, level, [], namespace_, name_='QueryInfoType')
1709 if self.hasContent_():
1710 outfile.write('>\n')
1711 self.exportChildren(outfile, level + 1, namespace_, name_)
1712 showIndent(outfile, level)
1713 outfile.write('</%s%s>\n' % (namespace_, name_))
1714 else:
1715 outfile.write('/>\n')
1716 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QueryInfoType'):
1718 - def exportChildren(self, outfile, level, namespace_='', name_='QueryInfoType'):
1719 if self.creationTime is not None:
1720 showIndent(outfile, level)
1721 outfile.write('<%screationTime>%s</%screationTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.creationTime).encode(ExternalEncoding), input_name='creationTime'), namespace_))
1722 if self.queryURL is not None:
1723 showIndent(outfile, level)
1724 outfile.write('<%squeryURL>%s</%squeryURL>\n' % (namespace_, self.gds_format_string(quote_xml(self.queryURL).encode(ExternalEncoding), input_name='queryURL'), namespace_))
1725 if self.querySQL is not None:
1726 showIndent(outfile, level)
1727 outfile.write('<%squerySQL>%s</%squerySQL>\n' % (namespace_, self.gds_format_string(quote_xml(self.querySQL).encode(ExternalEncoding), input_name='querySQL'), namespace_))
1728 if self.criteria:
1729 self.criteria.export(outfile, level, namespace_, name_='criteria')
1730 for note_ in self.note:
1731 note_.export(outfile, level, namespace_, name_='note')
1732 if self.extension is not None:
1733 showIndent(outfile, level)
1734 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
1735 - def hasContent_(self):
1736 if (
1737 self.creationTime is not None or
1738 self.queryURL is not None or
1739 self.querySQL is not None or
1740 self.criteria is not None or
1741 self.note or
1742 self.extension is not None
1743 ):
1744 return True
1745 else:
1746 return False
1747 - def exportLiteral(self, outfile, level, name_='QueryInfoType'):
1755 if self.creationTime is not None:
1756 showIndent(outfile, level)
1757 outfile.write('creationTime=%s,\n' % quote_python(self.creationTime).encode(ExternalEncoding))
1758 if self.queryURL is not None:
1759 showIndent(outfile, level)
1760 outfile.write('queryURL=%s,\n' % quote_python(self.queryURL).encode(ExternalEncoding))
1761 if self.querySQL is not None:
1762 showIndent(outfile, level)
1763 outfile.write('querySQL=%s,\n' % quote_python(self.querySQL).encode(ExternalEncoding))
1764 if self.criteria is not None:
1765 showIndent(outfile, level)
1766 outfile.write('criteria=model_.criteria(\n')
1767 self.criteria.exportLiteral(outfile, level)
1768 showIndent(outfile, level)
1769 outfile.write('),\n')
1770 showIndent(outfile, level)
1771 outfile.write('note=[\n')
1772 level += 1
1773 for note_ in self.note:
1774 showIndent(outfile, level)
1775 outfile.write('model_.NoteType(\n')
1776 note_.exportLiteral(outfile, level, name_='NoteType')
1777 showIndent(outfile, level)
1778 outfile.write('),\n')
1779 level -= 1
1780 showIndent(outfile, level)
1781 outfile.write('],\n')
1782 if self.extension is not None:
1783 showIndent(outfile, level)
1784 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
1792 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1793 if nodeName_ == 'creationTime':
1794 creationTime_ = child_.text
1795 self.creationTime = creationTime_
1796 elif nodeName_ == 'queryURL':
1797 queryURL_ = child_.text
1798 self.queryURL = queryURL_
1799 elif nodeName_ == 'querySQL':
1800 querySQL_ = child_.text
1801 self.querySQL = querySQL_
1802 elif nodeName_ == 'criteria':
1803 obj_ = criteria.factory()
1804 obj_.build(child_)
1805 self.set_criteria(obj_)
1806 elif nodeName_ == 'note':
1807 obj_ = NoteType.factory()
1808 obj_.build(child_)
1809 self.note.append(obj_)
1810 elif nodeName_ == 'extension':
1811 extension_ = child_.text
1812 self.extension = extension_
1813
1814
1815
1817 """The criteria are the actual parameters that are passed into the
1818 method. If you are generate this without a XML helper class, be
1819 sure to properly encode these elements."""
1820 subclass = None
1821 superclass = None
1822 - def __init__(self, locationParam=None, variableParam=None, timeParam=None):
1823 self.locationParam = locationParam
1824 self.variableParam = variableParam
1825 self.timeParam = timeParam
1831 factory = staticmethod(factory)
1838 - def export(self, outfile, level, namespace_='', name_='criteria', namespacedef_=''):
1839 showIndent(outfile, level)
1840 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1841 self.exportAttributes(outfile, level, [], namespace_, name_='criteria')
1842 if self.hasContent_():
1843 outfile.write('>\n')
1844 self.exportChildren(outfile, level + 1, namespace_, name_)
1845 showIndent(outfile, level)
1846 outfile.write('</%s%s>\n' % (namespace_, name_))
1847 else:
1848 outfile.write('/>\n')
1849 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='criteria'):
1851 - def exportChildren(self, outfile, level, namespace_='', name_='criteria'):
1852 if self.locationParam is not None:
1853 showIndent(outfile, level)
1854 outfile.write('<%slocationParam>%s</%slocationParam>\n' % (namespace_, self.gds_format_string(quote_xml(self.locationParam).encode(ExternalEncoding), input_name='locationParam'), namespace_))
1855 if self.variableParam is not None:
1856 showIndent(outfile, level)
1857 outfile.write('<%svariableParam>%s</%svariableParam>\n' % (namespace_, self.gds_format_string(quote_xml(self.variableParam).encode(ExternalEncoding), input_name='variableParam'), namespace_))
1858 if self.timeParam:
1859 self.timeParam.export(outfile, level, namespace_, name_='timeParam')
1860 - def hasContent_(self):
1861 if (
1862 self.locationParam is not None or
1863 self.variableParam is not None or
1864 self.timeParam is not None
1865 ):
1866 return True
1867 else:
1868 return False
1896 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1897 if nodeName_ == 'locationParam':
1898 locationParam_ = child_.text
1899 self.locationParam = locationParam_
1900 elif nodeName_ == 'variableParam':
1901 variableParam_ = child_.text
1902 self.variableParam = variableParam_
1903 elif nodeName_ == 'timeParam':
1904 obj_ = timeParam.factory()
1905 obj_.build(child_)
1906 self.set_timeParam(obj_)
1907
1908
1909
1911 """the begin and end time of the GetValues request used to generate a
1912 timeSeriesResponse."""
1913 subclass = None
1914 superclass = None
1915 - def __init__(self, beginDateTime=None, endDateTime=None):
1916 self.beginDateTime = beginDateTime
1917 self.endDateTime = endDateTime
1923 factory = staticmethod(factory)
1928 - def export(self, outfile, level, namespace_='', name_='timeParam', namespacedef_=''):
1929 showIndent(outfile, level)
1930 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1931 self.exportAttributes(outfile, level, [], namespace_, name_='timeParam')
1932 if self.hasContent_():
1933 outfile.write('>\n')
1934 self.exportChildren(outfile, level + 1, namespace_, name_)
1935 showIndent(outfile, level)
1936 outfile.write('</%s%s>\n' % (namespace_, name_))
1937 else:
1938 outfile.write('/>\n')
1939 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeParam'):
1941 - def exportChildren(self, outfile, level, namespace_='', name_='timeParam'):
1942 if self.beginDateTime is not None:
1943 showIndent(outfile, level)
1944 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_))
1945 if self.endDateTime is not None:
1946 showIndent(outfile, level)
1947 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
1948 - def hasContent_(self):
1949 if (
1950 self.beginDateTime is not None or
1951 self.endDateTime is not None
1952 ):
1953 return True
1954 else:
1955 return False
1977 - def buildChildren(self, child_, nodeName_, from_subclass=False):
1978 if nodeName_ == 'beginDateTime':
1979 beginDateTime_ = child_.text
1980 self.beginDateTime = beginDateTime_
1981 elif nodeName_ == 'endDateTime':
1982 endDateTime_ = child_.text
1983 self.endDateTime = endDateTime_
1984
1985
1986
1988 """variables is a list of variable elements (VariableInfoType)."""
1989 subclass = None
1990 superclass = None
1992 if variable is None:
1993 self.variable = []
1994 else:
1995 self.variable = variable
2001 factory = staticmethod(factory)
2003 - def set_variable(self, variable): self.variable = variable
2004 - def add_variable(self, value): self.variable.append(value)
2006 - def export(self, outfile, level, namespace_='', name_='variables', namespacedef_=''):
2007 showIndent(outfile, level)
2008 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2009 self.exportAttributes(outfile, level, [], namespace_, name_='variables')
2010 if self.hasContent_():
2011 outfile.write('>\n')
2012 self.exportChildren(outfile, level + 1, namespace_, name_)
2013 showIndent(outfile, level)
2014 outfile.write('</%s%s>\n' % (namespace_, name_))
2015 else:
2016 outfile.write('/>\n')
2017 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='variables'):
2019 - def exportChildren(self, outfile, level, namespace_='', name_='variables'):
2020 for variable_ in self.variable:
2021 variable_.export(outfile, level, namespace_, name_='variable')
2022 - def hasContent_(self):
2023 if (
2024 self.variable
2025 ):
2026 return True
2027 else:
2028 return False
2037 showIndent(outfile, level)
2038 outfile.write('variable=[\n')
2039 level += 1
2040 for variable_ in self.variable:
2041 showIndent(outfile, level)
2042 outfile.write('model_.VariableInfoType(\n')
2043 variable_.exportLiteral(outfile, level, name_='VariableInfoType')
2044 showIndent(outfile, level)
2045 outfile.write('),\n')
2046 level -= 1
2047 showIndent(outfile, level)
2048 outfile.write('],\n')
2056 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2061
2062
2063
2065 """The default time zone for this site (+00:00) and if this site shifts
2066 to daylight savings time (attribute: usesDaylightSavingsTime)If
2067 the location shifts it's data sources to Daylight Savings Time,
2068 this flag should be true."""
2069 subclass = None
2070 superclass = None
2071 - def __init__(self, siteUsesDaylightSavingsTime=False, defaultTimeZone=None, daylightSavingsTimeZone=None):
2080 factory = staticmethod(factory)
2087 - def export(self, outfile, level, namespace_='', name_='timeZoneInfo', namespacedef_=''):
2088 showIndent(outfile, level)
2089 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2090 self.exportAttributes(outfile, level, [], namespace_, name_='timeZoneInfo')
2091 if self.hasContent_():
2092 outfile.write('>\n')
2093 self.exportChildren(outfile, level + 1, namespace_, name_)
2094 showIndent(outfile, level)
2095 outfile.write('</%s%s>\n' % (namespace_, name_))
2096 else:
2097 outfile.write('/>\n')
2098 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='timeZoneInfo'):
2099 if self.siteUsesDaylightSavingsTime is not None and 'siteUsesDaylightSavingsTime' not in already_processed:
2100 already_processed.append('siteUsesDaylightSavingsTime')
2101 outfile.write(' siteUsesDaylightSavingsTime="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.siteUsesDaylightSavingsTime)), input_name='siteUsesDaylightSavingsTime'))
2102 - def exportChildren(self, outfile, level, namespace_='', name_='timeZoneInfo'):
2107 - def hasContent_(self):
2108 if (
2109 self.defaultTimeZone is not None or
2110 self.daylightSavingsTimeZone is not None
2111 ):
2112 return True
2113 else:
2114 return False
2121 if self.siteUsesDaylightSavingsTime is not None and 'siteUsesDaylightSavingsTime' not in already_processed:
2122 already_processed.append('siteUsesDaylightSavingsTime')
2123 showIndent(outfile, level)
2124 outfile.write('siteUsesDaylightSavingsTime = %s,\n' % (self.siteUsesDaylightSavingsTime,))
2138 value = attrs.get('siteUsesDaylightSavingsTime')
2139 if value is not None and 'siteUsesDaylightSavingsTime' not in already_processed:
2140 already_processed.append('siteUsesDaylightSavingsTime')
2141 if value in ('true', '1'):
2142 self.siteUsesDaylightSavingsTime = True
2143 elif value in ('false', '0'):
2144 self.siteUsesDaylightSavingsTime = False
2145 else:
2146 raise_parse_error(node, 'Bad boolean attribute')
2147 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2156
2157
2158
2160 """The default time zone for a site, specified in hours and minutes: hh:mm"""
2161 subclass = None
2162 superclass = None
2163 - def __init__(self, ZoneOffset=None, ZoneAbbreviation=None, valueOf_=None):
2164 self.ZoneOffset = _cast(None, ZoneOffset)
2165 self.ZoneAbbreviation = _cast(None, ZoneAbbreviation)
2166 self.valueOf_ = valueOf_
2172 factory = staticmethod(factory)
2178 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2179 - def export(self, outfile, level, namespace_='', name_='defaultTimeZone', namespacedef_=''):
2180 showIndent(outfile, level)
2181 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2182 self.exportAttributes(outfile, level, [], namespace_, name_='defaultTimeZone')
2183 if self.hasContent_():
2184 outfile.write('>')
2185 outfile.write(self.valueOf_)
2186 self.exportChildren(outfile, level + 1, namespace_, name_)
2187 outfile.write('</%s%s>\n' % (namespace_, name_))
2188 else:
2189 outfile.write('/>\n')
2190 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='defaultTimeZone'):
2191 outfile.write(' ZoneOffset=%s' % (self.gds_format_string(quote_attrib(self.ZoneOffset).encode(ExternalEncoding), input_name='ZoneOffset'), ))
2192 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed:
2193 already_processed.append('ZoneAbbreviation')
2194 outfile.write(' ZoneAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.ZoneAbbreviation).encode(ExternalEncoding), input_name='ZoneAbbreviation'), ))
2195 - def exportChildren(self, outfile, level, namespace_='', name_='defaultTimeZone'):
2197 - def hasContent_(self):
2198 if (
2199 self.valueOf_
2200 ):
2201 return True
2202 else:
2203 return False
2204 - def exportLiteral(self, outfile, level, name_='defaultTimeZone'):
2212 if self.ZoneOffset is not None and 'ZoneOffset' not in already_processed:
2213 already_processed.append('ZoneOffset')
2214 showIndent(outfile, level)
2215 outfile.write('ZoneOffset = "%s",\n' % (self.ZoneOffset,))
2216 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed:
2217 already_processed.append('ZoneAbbreviation')
2218 showIndent(outfile, level)
2219 outfile.write('ZoneAbbreviation = "%s",\n' % (self.ZoneAbbreviation,))
2229 value = attrs.get('ZoneOffset')
2230 if value is not None and 'ZoneOffset' not in already_processed:
2231 already_processed.append('ZoneOffset')
2232 self.ZoneOffset = value
2233 value = attrs.get('ZoneAbbreviation')
2234 if value is not None and 'ZoneAbbreviation' not in already_processed:
2235 already_processed.append('ZoneAbbreviation')
2236 self.ZoneAbbreviation = value
2237 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2239
2240
2241
2243 """The daylight savings time zone for a site, specified in hours and
2244 minutes: hh:mm"""
2245 subclass = None
2246 superclass = None
2247 - def __init__(self, ZoneOffset=None, ZoneAbbreviation=None, valueOf_=None):
2248 self.ZoneOffset = _cast(None, ZoneOffset)
2249 self.ZoneAbbreviation = _cast(None, ZoneAbbreviation)
2250 self.valueOf_ = valueOf_
2256 factory = staticmethod(factory)
2262 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2263 - def export(self, outfile, level, namespace_='', name_='daylightSavingsTimeZone', namespacedef_=''):
2264 showIndent(outfile, level)
2265 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2266 self.exportAttributes(outfile, level, [], namespace_, name_='daylightSavingsTimeZone')
2267 if self.hasContent_():
2268 outfile.write('>')
2269 outfile.write(self.valueOf_)
2270 self.exportChildren(outfile, level + 1, namespace_, name_)
2271 outfile.write('</%s%s>\n' % (namespace_, name_))
2272 else:
2273 outfile.write('/>\n')
2274 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='daylightSavingsTimeZone'):
2275 outfile.write(' ZoneOffset=%s' % (self.gds_format_string(quote_attrib(self.ZoneOffset).encode(ExternalEncoding), input_name='ZoneOffset'), ))
2276 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed:
2277 already_processed.append('ZoneAbbreviation')
2278 outfile.write(' ZoneAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.ZoneAbbreviation).encode(ExternalEncoding), input_name='ZoneAbbreviation'), ))
2279 - def exportChildren(self, outfile, level, namespace_='', name_='daylightSavingsTimeZone'):
2281 - def hasContent_(self):
2282 if (
2283 self.valueOf_
2284 ):
2285 return True
2286 else:
2287 return False
2288 - def exportLiteral(self, outfile, level, name_='daylightSavingsTimeZone'):
2296 if self.ZoneOffset is not None and 'ZoneOffset' not in already_processed:
2297 already_processed.append('ZoneOffset')
2298 showIndent(outfile, level)
2299 outfile.write('ZoneOffset = "%s",\n' % (self.ZoneOffset,))
2300 if self.ZoneAbbreviation is not None and 'ZoneAbbreviation' not in already_processed:
2301 already_processed.append('ZoneAbbreviation')
2302 showIndent(outfile, level)
2303 outfile.write('ZoneAbbreviation = "%s",\n' % (self.ZoneAbbreviation,))
2313 value = attrs.get('ZoneOffset')
2314 if value is not None and 'ZoneOffset' not in already_processed:
2315 already_processed.append('ZoneOffset')
2316 self.ZoneOffset = value
2317 value = attrs.get('ZoneAbbreviation')
2318 if value is not None and 'ZoneAbbreviation' not in already_processed:
2319 already_processed.append('ZoneAbbreviation')
2320 self.ZoneAbbreviation = value
2321 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2323
2324
2325
2327 subclass = None
2328 superclass = None
2339 factory = staticmethod(factory)
2344 - def export(self, outfile, level, namespace_='', name_='optionGroup', namespacedef_=''):
2345 showIndent(outfile, level)
2346 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2347 self.exportAttributes(outfile, level, [], namespace_, name_='optionGroup')
2348 if self.hasContent_():
2349 outfile.write('>\n')
2350 self.exportChildren(outfile, level + 1, namespace_, name_)
2351 showIndent(outfile, level)
2352 outfile.write('</%s%s>\n' % (namespace_, name_))
2353 else:
2354 outfile.write('/>\n')
2355 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='optionGroup'):
2357 - def exportChildren(self, outfile, level, namespace_='', name_='optionGroup'):
2358 for option_ in self.option:
2359 option_.export(outfile, level, namespace_, name_='option')
2360 - def hasContent_(self):
2361 if (
2362 self.option
2363 ):
2364 return True
2365 else:
2366 return False
2375 showIndent(outfile, level)
2376 outfile.write('option=[\n')
2377 level += 1
2378 for option_ in self.option:
2379 showIndent(outfile, level)
2380 outfile.write('model_.option(\n')
2381 option_.exportLiteral(outfile, level)
2382 showIndent(outfile, level)
2383 outfile.write('),\n')
2384 level -= 1
2385 showIndent(outfile, level)
2386 outfile.write('],\n')
2394 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2399
2400
2401
2403 subclass = None
2404 superclass = None
2405 - def __init__(self, title=None, href=None, type_=None, show=None, valueOf_=None, mixedclass_=None, content_=None):
2406 self.title = _cast(None, title)
2407 self.href = _cast(None, href)
2408 self.type_ = _cast(None, type_)
2409 self.show = _cast(None, show)
2410 self.valueOf_ = valueOf_
2411 if mixedclass_ is None:
2412 self.mixedclass_ = MixedContainer
2413 else:
2414 self.mixedclass_ = mixedclass_
2415 if content_ is None:
2416 self.content_ = []
2417 else:
2418 self.content_ = content_
2419 self.valueOf_ = valueOf_
2425 factory = staticmethod(factory)
2427 - def set_title(self, title): self.title = title
2429 - def set_href(self, href): self.href = href
2431 - def set_type(self, type_): self.type_ = type_
2436 - def set_show(self, show): self.show = show
2438 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2439 - def export(self, outfile, level, namespace_='', name_='DocumentationType', namespacedef_=''):
2440 showIndent(outfile, level)
2441 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2442 self.exportAttributes(outfile, level, [], namespace_, name_='DocumentationType')
2443 outfile.write('>')
2444 self.exportChildren(outfile, level + 1, namespace_, name_)
2445 outfile.write('</%s%s>\n' % (namespace_, name_))
2446 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DocumentationType'):
2447 if self.title is not None and 'title' not in already_processed:
2448 already_processed.append('title')
2449 outfile.write(' title=%s' % (self.gds_format_string(quote_attrib(self.title).encode(ExternalEncoding), input_name='title'), ))
2450 if self.href is not None and 'href' not in already_processed:
2451 already_processed.append('href')
2452 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))
2453 if self.type_ is not None and 'type_' not in already_processed:
2454 already_processed.append('type_')
2455 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
2456 if self.show is not None and 'show' not in already_processed:
2457 already_processed.append('show')
2458 outfile.write(' show=%s' % (self.gds_format_string(quote_attrib(self.show).encode(ExternalEncoding), input_name='show'), ))
2459 - def exportChildren(self, outfile, level, namespace_='', name_='DocumentationType'):
2461 - def hasContent_(self):
2462 if (
2463 self.valueOf_
2464 ):
2465 return True
2466 else:
2467 return False
2468 - def exportLiteral(self, outfile, level, name_='DocumentationType'):
2476 if self.title is not None and 'title' not in already_processed:
2477 already_processed.append('title')
2478 showIndent(outfile, level)
2479 outfile.write('title = "%s",\n' % (self.title,))
2480 if self.href is not None and 'href' not in already_processed:
2481 already_processed.append('href')
2482 showIndent(outfile, level)
2483 outfile.write('href = "%s",\n' % (self.href,))
2484 if self.type_ is not None and 'type_' not in already_processed:
2485 already_processed.append('type_')
2486 showIndent(outfile, level)
2487 outfile.write('type_ = "%s",\n' % (self.type_,))
2488 if self.show is not None and 'show' not in already_processed:
2489 already_processed.append('show')
2490 showIndent(outfile, level)
2491 outfile.write('show = "%s",\n' % (self.show,))
2505 value = attrs.get('title')
2506 if value is not None and 'title' not in already_processed:
2507 already_processed.append('title')
2508 self.title = value
2509 value = attrs.get('href')
2510 if value is not None and 'href' not in already_processed:
2511 already_processed.append('href')
2512 self.href = value
2513 value = attrs.get('type')
2514 if value is not None and 'type' not in already_processed:
2515 already_processed.append('type')
2516 self.type_ = value
2517 self.type_ = ' '.join(self.type_.split())
2518 value = attrs.get('show')
2519 if value is not None and 'show' not in already_processed:
2520 already_processed.append('show')
2521 self.show = value
2522 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2528
2529
2530
2532 """A list of options. Option elements are key-value pair elements that
2533 control how a variable maght be utilized in a service. Examples:
2534 MODIS web service. Information is aggreated over land or ocean
2535 or both. The plotarea option can include: plotarea=land,
2536 plotarea=land, plotarea=landocean USGS uses a statistic code,
2537 0003, to repesent a value type of 'Average'. The USGS statistic
2538 codes also several options that do not fit the ODM data model."""
2539 subclass = None
2540 superclass = None
2551 factory = staticmethod(factory)
2556 - def export(self, outfile, level, namespace_='', name_='options', namespacedef_=''):
2557 showIndent(outfile, level)
2558 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2559 self.exportAttributes(outfile, level, [], namespace_, name_='options')
2560 if self.hasContent_():
2561 outfile.write('>\n')
2562 self.exportChildren(outfile, level + 1, namespace_, name_)
2563 showIndent(outfile, level)
2564 outfile.write('</%s%s>\n' % (namespace_, name_))
2565 else:
2566 outfile.write('/>\n')
2567 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='options'):
2569 - def exportChildren(self, outfile, level, namespace_='', name_='options'):
2570 for option_ in self.option:
2571 option_.export(outfile, level, namespace_, name_='option')
2572 - def hasContent_(self):
2573 if (
2574 self.option
2575 ):
2576 return True
2577 else:
2578 return False
2587 showIndent(outfile, level)
2588 outfile.write('option=[\n')
2589 level += 1
2590 for option_ in self.option:
2591 showIndent(outfile, level)
2592 outfile.write('model_.option(\n')
2593 option_.exportLiteral(outfile, level)
2594 showIndent(outfile, level)
2595 outfile.write('),\n')
2596 level -= 1
2597 showIndent(outfile, level)
2598 outfile.write('],\n')
2606 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2611
2612
2613
2615 """SourceInfoType is used to describe the data source in the
2616 timeSeriesResponse. SourceInfoType is the base type for data
2617 source information. At present, two types are derived from
2618 SourceInfoType: SiteInfoType, and DataSetInfoType. SiteInfoType
2619 describes tlocation for a timeseries where that time series is
2620 located at a site or a DataSetInfoType describes time series
2621 derived from a dataset, such as a netCDF file, or a gridded
2622 model."""
2623 subclass = None
2624 superclass = None
2626 self.valueOf_ = valueOf_
2632 factory = staticmethod(factory)
2634 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2635 - def export(self, outfile, level, namespace_='', name_='SourceInfoType', namespacedef_=''):
2636 showIndent(outfile, level)
2637 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2638 self.exportAttributes(outfile, level, [], namespace_, name_='SourceInfoType')
2639 if self.hasContent_():
2640 outfile.write('>')
2641 outfile.write(self.valueOf_)
2642 self.exportChildren(outfile, level + 1, namespace_, name_)
2643 outfile.write('</%s%s>\n' % (namespace_, name_))
2644 else:
2645 outfile.write('/>\n')
2646 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SourceInfoType'):
2648 - def exportChildren(self, outfile, level, namespace_='', name_='SourceInfoType'):
2650 - def hasContent_(self):
2651 if (
2652 self.valueOf_
2653 ):
2654 return True
2655 else:
2656 return False
2657 - def exportLiteral(self, outfile, level, name_='SourceInfoType'):
2676 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2678
2679
2680
2682 """DataSetInfoType describes time series derived from a dataset, such
2683 as a netCDF file, or a gridded model."""
2684 subclass = None
2685 superclass = SourceInfoType
2686 - def __init__(self, dataSetIdentifier=None, timeZoneInfo=None, dataSetDescription=None, note=None, dataSetLocation=None, extension=None):
2687 super(DataSetInfoType, self).__init__()
2688 self.dataSetIdentifier = dataSetIdentifier
2689 self.timeZoneInfo = timeZoneInfo
2690 self.dataSetDescription = dataSetDescription
2691 if note is None:
2692 self.note = []
2693 else:
2694 self.note = note
2695 self.dataSetLocation = dataSetLocation
2696 self.extension = extension
2702 factory = staticmethod(factory)
2710 - def set_note(self, note): self.note = note
2711 - def add_note(self, value): self.note.append(value)
2717 - def export(self, outfile, level, namespace_='', name_='DataSetInfoType', namespacedef_=''):
2718 showIndent(outfile, level)
2719 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2720 self.exportAttributes(outfile, level, [], namespace_, name_='DataSetInfoType')
2721 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
2722 outfile.write(' xsi:type="DataSetInfoType"')
2723 if self.hasContent_():
2724 outfile.write('>\n')
2725 self.exportChildren(outfile, level + 1, namespace_, name_)
2726 showIndent(outfile, level)
2727 outfile.write('</%s%s>\n' % (namespace_, name_))
2728 else:
2729 outfile.write('/>\n')
2730 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DataSetInfoType'):
2732 - def exportChildren(self, outfile, level, namespace_='', name_='DataSetInfoType'):
2733 super(DataSetInfoType, self).exportChildren(outfile, level, namespace_, name_)
2734 if self.dataSetIdentifier is not None:
2735 showIndent(outfile, level)
2736 outfile.write('<%sdataSetIdentifier>%s</%sdataSetIdentifier>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataSetIdentifier).encode(ExternalEncoding), input_name='dataSetIdentifier'), namespace_))
2737 if self.timeZoneInfo:
2738 self.timeZoneInfo.export(outfile, level, namespace_, name_='timeZoneInfo')
2739 if self.dataSetDescription is not None:
2740 showIndent(outfile, level)
2741 outfile.write('<%sdataSetDescription>%s</%sdataSetDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataSetDescription).encode(ExternalEncoding), input_name='dataSetDescription'), namespace_))
2742 for note_ in self.note:
2743 note_.export(outfile, level, namespace_, name_='note')
2744 if self.dataSetLocation:
2745 self.dataSetLocation.export(outfile, level, namespace_, name_='dataSetLocation')
2746 if self.extension is not None:
2747 showIndent(outfile, level)
2748 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
2749 - def hasContent_(self):
2750 if (
2751 self.dataSetIdentifier is not None or
2752 self.timeZoneInfo is not None or
2753 self.dataSetDescription is not None or
2754 self.note or
2755 self.dataSetLocation is not None or
2756 self.extension is not None or
2757 super(DataSetInfoType, self).hasContent_()
2758 ):
2759 return True
2760 else:
2761 return False
2762 - def exportLiteral(self, outfile, level, name_='DataSetInfoType'):
2770 super(DataSetInfoType, self).exportLiteralChildren(outfile, level, name_)
2771 if self.dataSetIdentifier is not None:
2772 showIndent(outfile, level)
2773 outfile.write('dataSetIdentifier=%s,\n' % quote_python(self.dataSetIdentifier).encode(ExternalEncoding))
2774 if self.timeZoneInfo is not None:
2775 showIndent(outfile, level)
2776 outfile.write('timeZoneInfo=model_.timeZoneInfo(\n')
2777 self.timeZoneInfo.exportLiteral(outfile, level)
2778 showIndent(outfile, level)
2779 outfile.write('),\n')
2780 if self.dataSetDescription is not None:
2781 showIndent(outfile, level)
2782 outfile.write('dataSetDescription=%s,\n' % quote_python(self.dataSetDescription).encode(ExternalEncoding))
2783 showIndent(outfile, level)
2784 outfile.write('note=[\n')
2785 level += 1
2786 for note_ in self.note:
2787 showIndent(outfile, level)
2788 outfile.write('model_.NoteType(\n')
2789 note_.exportLiteral(outfile, level, name_='NoteType')
2790 showIndent(outfile, level)
2791 outfile.write('),\n')
2792 level -= 1
2793 showIndent(outfile, level)
2794 outfile.write('],\n')
2795 if self.dataSetLocation is not None:
2796 showIndent(outfile, level)
2797 outfile.write('dataSetLocation=model_.GeogLocationType(\n')
2798 self.dataSetLocation.exportLiteral(outfile, level, name_='dataSetLocation')
2799 showIndent(outfile, level)
2800 outfile.write('),\n')
2801 if self.extension is not None:
2802 showIndent(outfile, level)
2803 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
2811 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2812 if nodeName_ == 'dataSetIdentifier':
2813 dataSetIdentifier_ = child_.text
2814 self.dataSetIdentifier = dataSetIdentifier_
2815 elif nodeName_ == 'timeZoneInfo':
2816 obj_ = timeZoneInfo.factory()
2817 obj_.build(child_)
2818 self.set_timeZoneInfo(obj_)
2819 elif nodeName_ == 'dataSetDescription':
2820 dataSetDescription_ = child_.text
2821 self.dataSetDescription = dataSetDescription_
2822 elif nodeName_ == 'note':
2823 obj_ = NoteType.factory()
2824 obj_.build(child_)
2825 self.note.append(obj_)
2826 elif nodeName_ == 'dataSetLocation':
2827 obj_ = GeogLocationType.factory()
2828 obj_.build(child_)
2829 self.set_dataSetLocation(obj_)
2830 elif nodeName_ == 'extension':
2831 extension_ = child_.text
2832 self.extension = extension_
2833 super(DataSetInfoType, self).buildChildren(child_, nodeName_, True)
2834
2835
2836
2838 """time series (site-variable-observation) can have three types of time
2839 periods: 1) definite start and end time, or TimeIntervalType, 2)
2840 single observation, or TimeSingleType 3) Real Time station with
2841 moving window of data available, or TimeRealTimeType In order to
2842 simplify client development, all types now include
2843 beginDateTime, and endDateTime. A fourth type should be added:
2844 4) continuing site, where start is known, and site is still
2845 collecting data. This could be a realTimeType, or rename the
2846 real time type to TimeDefinedPeriodType."""
2847 subclass = None
2848 superclass = None
2850 self.valueOf_ = valueOf_
2856 factory = staticmethod(factory)
2858 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
2859 - def export(self, outfile, level, namespace_='', name_='TimePeriodType', namespacedef_=''):
2860 showIndent(outfile, level)
2861 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2862 self.exportAttributes(outfile, level, [], namespace_, name_='TimePeriodType')
2863 if self.hasContent_():
2864 outfile.write('>')
2865 outfile.write(self.valueOf_)
2866 self.exportChildren(outfile, level + 1, namespace_, name_)
2867 outfile.write('</%s%s>\n' % (namespace_, name_))
2868 else:
2869 outfile.write('/>\n')
2870 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimePeriodType'):
2872 - def exportChildren(self, outfile, level, namespace_='', name_='TimePeriodType'):
2874 - def hasContent_(self):
2875 if (
2876 self.valueOf_
2877 ):
2878 return True
2879 else:
2880 return False
2881 - def exportLiteral(self, outfile, level, name_='TimePeriodType'):
2900 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2902
2903
2904
2906 """For where a series has multiple observations, and a define
2907 beingDateTime as dateTime of the first data value in the series,
2908 and endDateTime dateTime of the last data value in the series."""
2909 subclass = None
2910 superclass = TimePeriodType
2911 - def __init__(self, beginDateTime=None, endDateTime=None):
2912 super(TimeIntervalType, self).__init__()
2913 self.beginDateTime = beginDateTime
2914 self.endDateTime = endDateTime
2920 factory = staticmethod(factory)
2925 - def export(self, outfile, level, namespace_='', name_='TimeIntervalType', namespacedef_=''):
2926 showIndent(outfile, level)
2927 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2928 self.exportAttributes(outfile, level, [], namespace_, name_='TimeIntervalType')
2929 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
2930 outfile.write(' xsi:type="TimeIntervalType"')
2931 if self.hasContent_():
2932 outfile.write('>\n')
2933 self.exportChildren(outfile, level + 1, namespace_, name_)
2934 showIndent(outfile, level)
2935 outfile.write('</%s%s>\n' % (namespace_, name_))
2936 else:
2937 outfile.write('/>\n')
2938 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeIntervalType'):
2940 - def exportChildren(self, outfile, level, namespace_='', name_='TimeIntervalType'):
2941 super(TimeIntervalType, self).exportChildren(outfile, level, namespace_, name_)
2942 if self.beginDateTime is not None:
2943 showIndent(outfile, level)
2944 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_))
2945 if self.endDateTime is not None:
2946 showIndent(outfile, level)
2947 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
2948 - def hasContent_(self):
2949 if (
2950 self.beginDateTime is not None or
2951 self.endDateTime is not None or
2952 super(TimeIntervalType, self).hasContent_()
2953 ):
2954 return True
2955 else:
2956 return False
2957 - def exportLiteral(self, outfile, level, name_='TimeIntervalType'):
2979 - def buildChildren(self, child_, nodeName_, from_subclass=False):
2980 if nodeName_ == 'beginDateTime':
2981 beginDateTime_ = child_.text
2982 self.beginDateTime = beginDateTime_
2983 elif nodeName_ == 'endDateTime':
2984 endDateTime_ = child_.text
2985 self.endDateTime = endDateTime_
2986 super(TimeIntervalType, self).buildChildren(child_, nodeName_, True)
2987
2988
2989
2991 """For where a series is a single observation. timeSingle,
2992 beginDateTime, and endDateTime will have the same value. The
2993 beginDateTime and endDateTime are provided to simplify usage by
2994 clients.They should be be calculated based on the duration
2995 stored in realTimeDataPeriod"""
2996 subclass = None
2997 superclass = TimePeriodType
2998 - def __init__(self, timeSingle=None, beginDateTime=None, endDateTime=None):
2999 super(TimeSingleType, self).__init__()
3000 self.timeSingle = timeSingle
3001 self.beginDateTime = beginDateTime
3002 self.endDateTime = endDateTime
3008 factory = staticmethod(factory)
3015 - def export(self, outfile, level, namespace_='', name_='TimeSingleType', namespacedef_=''):
3016 showIndent(outfile, level)
3017 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3018 self.exportAttributes(outfile, level, [], namespace_, name_='TimeSingleType')
3019 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
3020 outfile.write(' xsi:type="TimeSingleType"')
3021 if self.hasContent_():
3022 outfile.write('>\n')
3023 self.exportChildren(outfile, level + 1, namespace_, name_)
3024 showIndent(outfile, level)
3025 outfile.write('</%s%s>\n' % (namespace_, name_))
3026 else:
3027 outfile.write('/>\n')
3028 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeSingleType'):
3030 - def exportChildren(self, outfile, level, namespace_='', name_='TimeSingleType'):
3031 super(TimeSingleType, self).exportChildren(outfile, level, namespace_, name_)
3032 if self.timeSingle is not None:
3033 showIndent(outfile, level)
3034 outfile.write('<%stimeSingle>%s</%stimeSingle>\n' % (namespace_, self.gds_format_string(quote_xml(self.timeSingle).encode(ExternalEncoding), input_name='timeSingle'), namespace_))
3035 if self.beginDateTime is not None:
3036 showIndent(outfile, level)
3037 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_))
3038 if self.endDateTime is not None:
3039 showIndent(outfile, level)
3040 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
3041 - def hasContent_(self):
3042 if (
3043 self.timeSingle is not None or
3044 self.beginDateTime is not None or
3045 self.endDateTime is not None or
3046 super(TimeSingleType, self).hasContent_()
3047 ):
3048 return True
3049 else:
3050 return False
3051 - def exportLiteral(self, outfile, level, name_='TimeSingleType'):
3076 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3077 if nodeName_ == 'timeSingle':
3078 timeSingle_ = child_.text
3079 self.timeSingle = timeSingle_
3080 elif nodeName_ == 'beginDateTime':
3081 beginDateTime_ = child_.text
3082 self.beginDateTime = beginDateTime_
3083 elif nodeName_ == 'endDateTime':
3084 endDateTime_ = child_.text
3085 self.endDateTime = endDateTime_
3086 super(TimeSingleType, self).buildChildren(child_, nodeName_, True)
3087
3088
3089
3091 """Use where a site has an evolving period where data is available. The
3092 US Geological Survey real time data is available for 30 days,
3093 the realTimeDataPeriod element is an XML duration and woudl be
3094 "30d" The beginDateTime and endDateTime are provided to simplify
3095 usage by clients.They should be be calculated based on the
3096 duration stored in realTimeDataPeriod"""
3097 subclass = None
3098 superclass = TimePeriodType
3099 - def __init__(self, realTimeDataPeriod=None, beginDateTime=None, endDateTime=None):
3100 super(TimePeriodRealTimeType, self).__init__()
3101 self.realTimeDataPeriod = realTimeDataPeriod
3102 self.beginDateTime = beginDateTime
3103 self.endDateTime = endDateTime
3109 factory = staticmethod(factory)
3116 - def export(self, outfile, level, namespace_='', name_='TimePeriodRealTimeType', namespacedef_=''):
3117 showIndent(outfile, level)
3118 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3119 self.exportAttributes(outfile, level, [], namespace_, name_='TimePeriodRealTimeType')
3120 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
3121 outfile.write(' xsi:type="TimePeriodRealTimeType"')
3122 if self.hasContent_():
3123 outfile.write('>\n')
3124 self.exportChildren(outfile, level + 1, namespace_, name_)
3125 showIndent(outfile, level)
3126 outfile.write('</%s%s>\n' % (namespace_, name_))
3127 else:
3128 outfile.write('/>\n')
3129 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimePeriodRealTimeType'):
3131 - def exportChildren(self, outfile, level, namespace_='', name_='TimePeriodRealTimeType'):
3132 super(TimePeriodRealTimeType, self).exportChildren(outfile, level, namespace_, name_)
3133 if self.realTimeDataPeriod is not None:
3134 showIndent(outfile, level)
3135 outfile.write('<%srealTimeDataPeriod>%s</%srealTimeDataPeriod>\n' % (namespace_, self.gds_format_string(quote_xml(self.realTimeDataPeriod).encode(ExternalEncoding), input_name='realTimeDataPeriod'), namespace_))
3136 if self.beginDateTime is not None:
3137 showIndent(outfile, level)
3138 outfile.write('<%sbeginDateTime>%s</%sbeginDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.beginDateTime).encode(ExternalEncoding), input_name='beginDateTime'), namespace_))
3139 if self.endDateTime is not None:
3140 showIndent(outfile, level)
3141 outfile.write('<%sendDateTime>%s</%sendDateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDateTime).encode(ExternalEncoding), input_name='endDateTime'), namespace_))
3142 - def hasContent_(self):
3143 if (
3144 self.realTimeDataPeriod is not None or
3145 self.beginDateTime is not None or
3146 self.endDateTime is not None or
3147 super(TimePeriodRealTimeType, self).hasContent_()
3148 ):
3149 return True
3150 else:
3151 return False
3152 - def exportLiteral(self, outfile, level, name_='TimePeriodRealTimeType'):
3177 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3178 if nodeName_ == 'realTimeDataPeriod':
3179 realTimeDataPeriod_ = child_.text
3180 self.realTimeDataPeriod = realTimeDataPeriod_
3181 elif nodeName_ == 'beginDateTime':
3182 beginDateTime_ = child_.text
3183 self.beginDateTime = beginDateTime_
3184 elif nodeName_ == 'endDateTime':
3185 endDateTime_ = child_.text
3186 self.endDateTime = endDateTime_
3187 super(TimePeriodRealTimeType, self).buildChildren(child_, nodeName_, True)
3188
3189
3190
3192 """GeogLocationType is the base class for the two geometry types:
3193 LatLonPointType, and LatLonBoxType. Any additional types should
3194 derive from this type. The default spatial reference system is
3195 @srs is EPSG:4326 or Geographic lat long."""
3196 subclass = None
3197 superclass = None
3198 - def __init__(self, srs='EPSG:4326', valueOf_=None):
3199 self.srs = _cast(None, srs)
3200 self.valueOf_ = valueOf_
3206 factory = staticmethod(factory)
3207 - def get_srs(self): return self.srs
3208 - def set_srs(self, srs): self.srs = srs
3210 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
3211 - def export(self, outfile, level, namespace_='', name_='GeogLocationType', namespacedef_=''):
3212 showIndent(outfile, level)
3213 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3214 self.exportAttributes(outfile, level, [], namespace_, name_='GeogLocationType')
3215 if self.hasContent_():
3216 outfile.write('>')
3217 outfile.write(self.valueOf_)
3218 self.exportChildren(outfile, level + 1, namespace_, name_)
3219 outfile.write('</%s%s>\n' % (namespace_, name_))
3220 else:
3221 outfile.write('/>\n')
3222 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='GeogLocationType'):
3223 if self.srs is not None and 'srs' not in already_processed:
3224 already_processed.append('srs')
3225 outfile.write(' srs=%s' % (self.gds_format_string(quote_attrib(self.srs).encode(ExternalEncoding), input_name='srs'), ))
3226 - def exportChildren(self, outfile, level, namespace_='', name_='GeogLocationType'):
3228 - def hasContent_(self):
3229 if (
3230 self.valueOf_
3231 ):
3232 return True
3233 else:
3234 return False
3235 - def exportLiteral(self, outfile, level, name_='GeogLocationType'):
3243 if self.srs is not None and 'srs' not in already_processed:
3244 already_processed.append('srs')
3245 showIndent(outfile, level)
3246 outfile.write('srs = "%s",\n' % (self.srs,))
3256 value = attrs.get('srs')
3257 if value is not None and 'srs' not in already_processed:
3258 already_processed.append('srs')
3259 self.srs = value
3260 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3262
3263
3264
3266 subclass = None
3267 superclass = GeogLocationType
3268 - def __init__(self, srs='EPSG:4326', latitude=None, longitude=None):
3277 factory = staticmethod(factory)
3279 - def set_latitude(self, latitude): self.latitude = latitude
3288 - def export(self, outfile, level, namespace_='', name_='LatLonPointType', namespacedef_=''):
3289 showIndent(outfile, level)
3290 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3291 self.exportAttributes(outfile, level, [], namespace_, name_='LatLonPointType')
3292 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
3293 outfile.write(' xsi:type="LatLonPointType"')
3294 if self.hasContent_():
3295 outfile.write('>\n')
3296 self.exportChildren(outfile, level + 1, namespace_, name_)
3297 showIndent(outfile, level)
3298 outfile.write('</%s%s>\n' % (namespace_, name_))
3299 else:
3300 outfile.write('/>\n')
3301 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LatLonPointType'):
3303 - def exportChildren(self, outfile, level, namespace_='', name_='LatLonPointType'):
3304 super(LatLonPointType, self).exportChildren(outfile, level, namespace_, name_)
3305 if self.latitude is not None:
3306 showIndent(outfile, level)
3307 outfile.write('<%slatitude>%s</%slatitude>\n' % (namespace_, self.gds_format_double(self.latitude, input_name='latitude'), namespace_))
3308 if self.longitude is not None:
3309 showIndent(outfile, level)
3310 outfile.write('<%slongitude>%s</%slongitude>\n' % (namespace_, self.gds_format_double(self.longitude, input_name='longitude'), namespace_))
3311 - def hasContent_(self):
3312 if (
3313 self.latitude is not None or
3314 self.longitude is not None or
3315 super(LatLonPointType, self).hasContent_()
3316 ):
3317 return True
3318 else:
3319 return False
3320 - def exportLiteral(self, outfile, level, name_='LatLonPointType'):
3328 super(LatLonPointType, self).exportLiteralChildren(outfile, level, name_)
3329 if self.latitude is not None:
3330 showIndent(outfile, level)
3331 outfile.write('latitude=%e,\n' % self.latitude)
3332 if self.longitude is not None:
3333 showIndent(outfile, level)
3334 outfile.write('longitude=%e,\n' % self.longitude)
3342 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3343 if nodeName_ == 'latitude':
3344 sval_ = child_.text
3345 try:
3346 fval_ = float(sval_)
3347 except (TypeError, ValueError), exp:
3348 raise_parse_error(child_, 'requires float or double: %s' % exp)
3349 self.latitude = fval_
3350 self.validate_latitude(self.latitude)
3351 elif nodeName_ == 'longitude':
3352 sval_ = child_.text
3353 try:
3354 fval_ = float(sval_)
3355 except (TypeError, ValueError), exp:
3356 raise_parse_error(child_, 'requires float or double: %s' % exp)
3357 self.longitude = fval_
3358 self.validate_longitude(self.longitude)
3359 super(LatLonPointType, self).buildChildren(child_, nodeName_, True)
3360
3361
3362
3364 subclass = None
3365 superclass = GeogLocationType
3366 - def __init__(self, srs='EPSG:4326', south=None, west=None, north=None, east=None):
3367 super(LatLonBoxType, self).__init__(srs, )
3368 self.south = south
3369 self.west = west
3370 self.north = north
3371 self.east = east
3377 factory = staticmethod(factory)
3379 - def set_south(self, south): self.south = south
3384 - def set_west(self, west): self.west = west
3389 - def set_north(self, north): self.north = north
3394 - def set_east(self, east): self.east = east
3398 - def export(self, outfile, level, namespace_='', name_='LatLonBoxType', namespacedef_=''):
3399 showIndent(outfile, level)
3400 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3401 self.exportAttributes(outfile, level, [], namespace_, name_='LatLonBoxType')
3402 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
3403 outfile.write(' xsi:type="LatLonBoxType"')
3404 if self.hasContent_():
3405 outfile.write('>\n')
3406 self.exportChildren(outfile, level + 1, namespace_, name_)
3407 showIndent(outfile, level)
3408 outfile.write('</%s%s>\n' % (namespace_, name_))
3409 else:
3410 outfile.write('/>\n')
3411 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LatLonBoxType'):
3413 - def exportChildren(self, outfile, level, namespace_='', name_='LatLonBoxType'):
3414 super(LatLonBoxType, self).exportChildren(outfile, level, namespace_, name_)
3415 if self.south is not None:
3416 showIndent(outfile, level)
3417 outfile.write('<%ssouth>%s</%ssouth>\n' % (namespace_, self.gds_format_double(self.south, input_name='south'), namespace_))
3418 if self.west is not None:
3419 showIndent(outfile, level)
3420 outfile.write('<%swest>%s</%swest>\n' % (namespace_, self.gds_format_double(self.west, input_name='west'), namespace_))
3421 if self.north is not None:
3422 showIndent(outfile, level)
3423 outfile.write('<%snorth>%s</%snorth>\n' % (namespace_, self.gds_format_double(self.north, input_name='north'), namespace_))
3424 if self.east is not None:
3425 showIndent(outfile, level)
3426 outfile.write('<%seast>%s</%seast>\n' % (namespace_, self.gds_format_double(self.east, input_name='east'), namespace_))
3427 - def hasContent_(self):
3428 if (
3429 self.south is not None or
3430 self.west is not None or
3431 self.north is not None or
3432 self.east is not None or
3433 super(LatLonBoxType, self).hasContent_()
3434 ):
3435 return True
3436 else:
3437 return False
3438 - def exportLiteral(self, outfile, level, name_='LatLonBoxType'):
3446 super(LatLonBoxType, self).exportLiteralChildren(outfile, level, name_)
3447 if self.south is not None:
3448 showIndent(outfile, level)
3449 outfile.write('south=%e,\n' % self.south)
3450 if self.west is not None:
3451 showIndent(outfile, level)
3452 outfile.write('west=%e,\n' % self.west)
3453 if self.north is not None:
3454 showIndent(outfile, level)
3455 outfile.write('north=%e,\n' % self.north)
3456 if self.east is not None:
3457 showIndent(outfile, level)
3458 outfile.write('east=%e,\n' % self.east)
3466 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3467 if nodeName_ == 'south':
3468 sval_ = child_.text
3469 try:
3470 fval_ = float(sval_)
3471 except (TypeError, ValueError), exp:
3472 raise_parse_error(child_, 'requires float or double: %s' % exp)
3473 self.south = fval_
3474 self.validate_south(self.south)
3475 elif nodeName_ == 'west':
3476 sval_ = child_.text
3477 try:
3478 fval_ = float(sval_)
3479 except (TypeError, ValueError), exp:
3480 raise_parse_error(child_, 'requires float or double: %s' % exp)
3481 self.west = fval_
3482 self.validate_west(self.west)
3483 elif nodeName_ == 'north':
3484 sval_ = child_.text
3485 try:
3486 fval_ = float(sval_)
3487 except (TypeError, ValueError), exp:
3488 raise_parse_error(child_, 'requires float or double: %s' % exp)
3489 self.north = fval_
3490 self.validate_north(self.north)
3491 elif nodeName_ == 'east':
3492 sval_ = child_.text
3493 try:
3494 fval_ = float(sval_)
3495 except (TypeError, ValueError), exp:
3496 raise_parse_error(child_, 'requires float or double: %s' % exp)
3497 self.east = fval_
3498 self.validate_east(self.east)
3499 super(LatLonBoxType, self).buildChildren(child_, nodeName_, True)
3500
3501
3502
3504 """Series catalog represents a list of series, where each separate data
3505 series are for the purposes of identifying or displaying what
3506 data are available at each site. For clients, this is the list
3507 of the html select group element. This would allow for groups or
3508 seriesCatalogs to appear in an HTML select menu.(depreciated)
3509 location of the WaterOneFlow service that the client should
3510 execute GetValues call on. All services now proxy getValues
3511 methods from other sources."""
3512 subclass = None
3513 superclass = None
3514 - def __init__(self, menuGroupName=None, serviceWsdl=None, note=None, series=None):
3515 self.menuGroupName = _cast(None, menuGroupName)
3516 self.serviceWsdl = _cast(None, serviceWsdl)
3517 if note is None:
3518 self.note = []
3519 else:
3520 self.note = note
3521 if series is None:
3522 self.series = []
3523 else:
3524 self.series = series
3530 factory = staticmethod(factory)
3532 - def set_note(self, note): self.note = note
3533 - def add_note(self, value): self.note.append(value)
3543 - def export(self, outfile, level, namespace_='', name_='seriesCatalogType', namespacedef_=''):
3544 showIndent(outfile, level)
3545 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3546 self.exportAttributes(outfile, level, [], namespace_, name_='seriesCatalogType')
3547 if self.hasContent_():
3548 outfile.write('>\n')
3549 self.exportChildren(outfile, level + 1, namespace_, name_)
3550 showIndent(outfile, level)
3551 outfile.write('</%s%s>\n' % (namespace_, name_))
3552 else:
3553 outfile.write('/>\n')
3554 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='seriesCatalogType'):
3555 if self.menuGroupName is not None and 'menuGroupName' not in already_processed:
3556 already_processed.append('menuGroupName')
3557 outfile.write(' menuGroupName=%s' % (self.gds_format_string(quote_attrib(self.menuGroupName).encode(ExternalEncoding), input_name='menuGroupName'), ))
3558 if self.serviceWsdl is not None and 'serviceWsdl' not in already_processed:
3559 already_processed.append('serviceWsdl')
3560 outfile.write(' serviceWsdl=%s' % (self.gds_format_string(quote_attrib(self.serviceWsdl).encode(ExternalEncoding), input_name='serviceWsdl'), ))
3561 - def exportChildren(self, outfile, level, namespace_='', name_='seriesCatalogType'):
3562 for note_ in self.note:
3563 note_.export(outfile, level, namespace_, name_='note')
3564 for series_ in self.series:
3565 series_.export(outfile, level, namespace_, name_='series')
3566 - def hasContent_(self):
3567 if (
3568 self.note or
3569 self.series
3570 ):
3571 return True
3572 else:
3573 return False
3574 - def exportLiteral(self, outfile, level, name_='seriesCatalogType'):
3580 if self.menuGroupName is not None and 'menuGroupName' not in already_processed:
3581 already_processed.append('menuGroupName')
3582 showIndent(outfile, level)
3583 outfile.write('menuGroupName = "%s",\n' % (self.menuGroupName,))
3584 if self.serviceWsdl is not None and 'serviceWsdl' not in already_processed:
3585 already_processed.append('serviceWsdl')
3586 showIndent(outfile, level)
3587 outfile.write('serviceWsdl = "%s",\n' % (self.serviceWsdl,))
3589 showIndent(outfile, level)
3590 outfile.write('note=[\n')
3591 level += 1
3592 for note_ in self.note:
3593 showIndent(outfile, level)
3594 outfile.write('model_.NoteType(\n')
3595 note_.exportLiteral(outfile, level, name_='NoteType')
3596 showIndent(outfile, level)
3597 outfile.write('),\n')
3598 level -= 1
3599 showIndent(outfile, level)
3600 outfile.write('],\n')
3601 showIndent(outfile, level)
3602 outfile.write('series=[\n')
3603 level += 1
3604 for series_ in self.series:
3605 showIndent(outfile, level)
3606 outfile.write('model_.series(\n')
3607 series_.exportLiteral(outfile, level)
3608 showIndent(outfile, level)
3609 outfile.write('),\n')
3610 level -= 1
3611 showIndent(outfile, level)
3612 outfile.write('],\n')
3619 value = attrs.get('menuGroupName')
3620 if value is not None and 'menuGroupName' not in already_processed:
3621 already_processed.append('menuGroupName')
3622 self.menuGroupName = value
3623 value = attrs.get('serviceWsdl')
3624 if value is not None and 'serviceWsdl' not in already_processed:
3625 already_processed.append('serviceWsdl')
3626 self.serviceWsdl = value
3627 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3628 if nodeName_ == 'note':
3629 obj_ = NoteType.factory()
3630 obj_.build(child_)
3631 self.note.append(obj_)
3632 elif nodeName_ == 'series':
3633 obj_ = series.factory()
3634 obj_.build(child_)
3635 self.series.append(obj_)
3636
3637
3638
3639 -class series(GeneratedsSuper):
3640 """Separate data series are for the purposes of identifying or
3641 displaying what data are available at each site. Site
3642 information is a parent of the series so that it does not need
3643 to be repeated (difference from the ODM. ). A Site contains one
3644 or more seriesCatalogs which contain one or more series.
3645 Assotiated with site, a series is a unique combination of the
3646 textual repesentation of ODM series:
3647 Variable,Method,Source,QualityControlLevel. An ODM series is a
3648 unique site/variable combinations are defined by unique
3649 combinations of SiteID, VariableID, MethodID, SourceID, and
3650 QualityControlLevelID."""
3651 subclass = None
3652 superclass = None
3653 - def __init__(self, dataType=None, variable=None, valueCount=None, variableTimeInterval=None, valueType=None, generalCategory=None, sampleMedium=None, Method=None, Source=None, QualityControlLevel=None):
3669 factory = staticmethod(factory)
3671 - def set_dataType(self, dataType): self.dataType = dataType
3676 - def set_variable(self, variable): self.variable = variable
3702 - def export(self, outfile, level, namespace_='', name_='series', namespacedef_=''):
3703 showIndent(outfile, level)
3704 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3705 self.exportAttributes(outfile, level, [], namespace_, name_='series')
3706 if self.hasContent_():
3707 outfile.write('>\n')
3708 self.exportChildren(outfile, level + 1, namespace_, name_)
3709 showIndent(outfile, level)
3710 outfile.write('</%s%s>\n' % (namespace_, name_))
3711 else:
3712 outfile.write('/>\n')
3713 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='series'):
3715 - def exportChildren(self, outfile, level, namespace_='', name_='series'):
3716 if self.dataType is not None:
3717 showIndent(outfile, level)
3718 outfile.write('<%sdataType>%s</%sdataType>\n' % (namespace_, self.gds_format_string(quote_xml(self.dataType).encode(ExternalEncoding), input_name='dataType'), namespace_))
3719 if self.variable:
3720 self.variable.export(outfile, level, namespace_, name_='variable', )
3721 if self.valueCount:
3722 self.valueCount.export(outfile, level, namespace_, name_='valueCount', )
3723 if self.variableTimeInterval:
3724 self.variableTimeInterval.export(outfile, level, namespace_, name_='variableTimeInterval', )
3725 if self.valueType is not None:
3726 showIndent(outfile, level)
3727 outfile.write('<%svalueType>%s</%svalueType>\n' % (namespace_, self.gds_format_string(quote_xml(self.valueType).encode(ExternalEncoding), input_name='valueType'), namespace_))
3728 if self.generalCategory is not None:
3729 showIndent(outfile, level)
3730 outfile.write('<%sgeneralCategory>%s</%sgeneralCategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.generalCategory).encode(ExternalEncoding), input_name='generalCategory'), namespace_))
3731 if self.sampleMedium is not None:
3732 showIndent(outfile, level)
3733 outfile.write('<%ssampleMedium>%s</%ssampleMedium>\n' % (namespace_, self.gds_format_string(quote_xml(self.sampleMedium).encode(ExternalEncoding), input_name='sampleMedium'), namespace_))
3734 if self.Method:
3735 self.Method.export(outfile, level, namespace_, name_='Method')
3736 if self.Source:
3737 self.Source.export(outfile, level, namespace_, name_='Source')
3738 if self.QualityControlLevel:
3739 self.QualityControlLevel.export(outfile, level, namespace_, name_='QualityControlLevel')
3740 - def hasContent_(self):
3741 if (
3742 self.dataType is not None or
3743 self.variable is not None or
3744 self.valueCount is not None or
3745 self.variableTimeInterval is not None or
3746 self.valueType is not None or
3747 self.generalCategory is not None or
3748 self.sampleMedium is not None or
3749 self.Method is not None or
3750 self.Source is not None or
3751 self.QualityControlLevel is not None
3752 ):
3753 return True
3754 else:
3755 return False
3764 if self.dataType is not None:
3765 showIndent(outfile, level)
3766 outfile.write('dataType=%s,\n' % quote_python(self.dataType).encode(ExternalEncoding))
3767 if self.variable is not None:
3768 showIndent(outfile, level)
3769 outfile.write('variable=model_.VariableInfoType(\n')
3770 self.variable.exportLiteral(outfile, level, name_='variable')
3771 showIndent(outfile, level)
3772 outfile.write('),\n')
3773 if self.valueCount is not None:
3774 showIndent(outfile, level)
3775 outfile.write('valueCount=model_.valueCount(\n')
3776 self.valueCount.exportLiteral(outfile, level)
3777 showIndent(outfile, level)
3778 outfile.write('),\n')
3779 if self.variableTimeInterval is not None:
3780 showIndent(outfile, level)
3781 outfile.write('variableTimeInterval=model_.TimePeriodType(\n')
3782 self.variableTimeInterval.exportLiteral(outfile, level, name_='variableTimeInterval')
3783 showIndent(outfile, level)
3784 outfile.write('),\n')
3785 if self.valueType is not None:
3786 showIndent(outfile, level)
3787 outfile.write('valueType=%s,\n' % quote_python(self.valueType).encode(ExternalEncoding))
3788 if self.generalCategory is not None:
3789 showIndent(outfile, level)
3790 outfile.write('generalCategory=%s,\n' % quote_python(self.generalCategory).encode(ExternalEncoding))
3791 if self.sampleMedium is not None:
3792 showIndent(outfile, level)
3793 outfile.write('sampleMedium=%s,\n' % quote_python(self.sampleMedium).encode(ExternalEncoding))
3794 if self.Method is not None:
3795 showIndent(outfile, level)
3796 outfile.write('Method=model_.MethodType(\n')
3797 self.Method.exportLiteral(outfile, level, name_='Method')
3798 showIndent(outfile, level)
3799 outfile.write('),\n')
3800 if self.Source is not None:
3801 showIndent(outfile, level)
3802 outfile.write('Source=model_.SourceType(\n')
3803 self.Source.exportLiteral(outfile, level, name_='Source')
3804 showIndent(outfile, level)
3805 outfile.write('),\n')
3806 if self.QualityControlLevel is not None:
3807 showIndent(outfile, level)
3808 outfile.write('QualityControlLevel=model_.QualityControlLevelType(\n')
3809 self.QualityControlLevel.exportLiteral(outfile, level, name_='QualityControlLevel')
3810 showIndent(outfile, level)
3811 outfile.write('),\n')
3819 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3860
3861
3862
3864 subclass = None
3865 superclass = None
3866 - def __init__(self, countIsEstimated=None, valueOf_=None):
3867 self.countIsEstimated = _cast(bool, countIsEstimated)
3868 self.valueOf_ = valueOf_
3874 factory = staticmethod(factory)
3878 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
3879 - def export(self, outfile, level, namespace_='', name_='valueCount', namespacedef_=''):
3880 showIndent(outfile, level)
3881 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3882 self.exportAttributes(outfile, level, [], namespace_, name_='valueCount')
3883 if self.hasContent_():
3884 outfile.write('>')
3885 outfile.write(self.valueOf_)
3886 self.exportChildren(outfile, level + 1, namespace_, name_)
3887 outfile.write('</%s%s>\n' % (namespace_, name_))
3888 else:
3889 outfile.write('/>\n')
3890 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='valueCount'):
3891 if self.countIsEstimated is not None and 'countIsEstimated' not in already_processed:
3892 already_processed.append('countIsEstimated')
3893 outfile.write(' countIsEstimated="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.countIsEstimated)), input_name='countIsEstimated'))
3894 - def exportChildren(self, outfile, level, namespace_='', name_='valueCount'):
3896 - def hasContent_(self):
3897 if (
3898 self.valueOf_
3899 ):
3900 return True
3901 else:
3902 return False
3911 if self.countIsEstimated is not None and 'countIsEstimated' not in already_processed:
3912 already_processed.append('countIsEstimated')
3913 showIndent(outfile, level)
3914 outfile.write('countIsEstimated = %s,\n' % (self.countIsEstimated,))
3924 value = attrs.get('countIsEstimated')
3925 if value is not None and 'countIsEstimated' not in already_processed:
3926 already_processed.append('countIsEstimated')
3927 if value in ('true', '1'):
3928 self.countIsEstimated = True
3929 elif value in ('false', '0'):
3930 self.countIsEstimated = False
3931 else:
3932 raise_parse_error(node, 'Bad boolean attribute')
3933 - def buildChildren(self, child_, nodeName_, from_subclass=False):
3935
3936
3937
3939 """qualifying comments that accompany the data"""
3940 subclass = None
3941 superclass = None
3949 factory = staticmethod(factory)
3952 - def export(self, outfile, level, namespace_='', name_='QualifiersType', namespacedef_=''):
3953 showIndent(outfile, level)
3954 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3955 self.exportAttributes(outfile, level, [], namespace_, name_='QualifiersType')
3956 if self.hasContent_():
3957 outfile.write('>\n')
3958 self.exportChildren(outfile, level + 1, namespace_, name_)
3959 showIndent(outfile, level)
3960 outfile.write('</%s%s>\n' % (namespace_, name_))
3961 else:
3962 outfile.write('/>\n')
3963 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QualifiersType'):
3965 - def exportChildren(self, outfile, level, namespace_='', name_='QualifiersType'):
3968 - def hasContent_(self):
3969 if (
3970 self.qualifier is not None
3971 ):
3972 return True
3973 else:
3974 return False
3975 - def exportLiteral(self, outfile, level, name_='QualifiersType'):
3996 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4001
4002
4003
4005 """qualifying comments that accompany the data. value/@qaulifier is a
4006 space delimted list of qualifiers for a data value.
4007 @qualifierCode is the link to the value/@qualifier for a single
4008 value The value inside provides the textual description.
4009 @qualifierCode is the reference code. @qualifierCode=A qualifier
4010 value=Approved @vocabulary and @network are suggested. For
4011 example a value from the USGS may qualifiers from multiple
4012 vocabularies, and the network would be the data service."""
4013 subclass = None
4014 superclass = None
4015 - def __init__(self, qualifierID=None, default=None, network=None, vocabulary=None, qualifierCode=None):
4026 factory = staticmethod(factory)
4032 - def set_default(self, default): self.default = default
4037 - def export(self, outfile, level, namespace_='', name_='qualifier', namespacedef_=''):
4038 showIndent(outfile, level)
4039 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4040 self.exportAttributes(outfile, level, [], namespace_, name_='qualifier')
4041 if self.hasContent_():
4042 outfile.write('>\n')
4043 self.exportChildren(outfile, level + 1, namespace_, name_)
4044 showIndent(outfile, level)
4045 outfile.write('</%s%s>\n' % (namespace_, name_))
4046 else:
4047 outfile.write('/>\n')
4048 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='qualifier'):
4049 if self.qualifierID is not None and 'qualifierID' not in already_processed:
4050 already_processed.append('qualifierID')
4051 outfile.write(' qualifierID="%s"' % self.gds_format_integer(self.qualifierID, input_name='qualifierID'))
4052 if self.default is not None and 'default' not in already_processed:
4053 already_processed.append('default')
4054 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default'))
4055 if self.network is not None and 'network' not in already_processed:
4056 already_processed.append('network')
4057 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), ))
4058 if self.vocabulary is not None and 'vocabulary' not in already_processed:
4059 already_processed.append('vocabulary')
4060 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), ))
4061 - def exportChildren(self, outfile, level, namespace_='', name_='qualifier'):
4062 if self.qualifierCode is not None:
4063 showIndent(outfile, level)
4064 outfile.write('<%squalifierCode>%s</%squalifierCode>\n' % (namespace_, self.gds_format_string(quote_xml(self.qualifierCode).encode(ExternalEncoding), input_name='qualifierCode'), namespace_))
4065 - def hasContent_(self):
4066 if (
4067 self.qualifierCode is not None
4068 ):
4069 return True
4070 else:
4071 return False
4078 if self.qualifierID is not None and 'qualifierID' not in already_processed:
4079 already_processed.append('qualifierID')
4080 showIndent(outfile, level)
4081 outfile.write('qualifierID = %d,\n' % (self.qualifierID,))
4082 if self.default is not None and 'default' not in already_processed:
4083 already_processed.append('default')
4084 showIndent(outfile, level)
4085 outfile.write('default = %s,\n' % (self.default,))
4086 if self.network is not None and 'network' not in already_processed:
4087 already_processed.append('network')
4088 showIndent(outfile, level)
4089 outfile.write('network = "%s",\n' % (self.network,))
4090 if self.vocabulary is not None and 'vocabulary' not in already_processed:
4091 already_processed.append('vocabulary')
4092 showIndent(outfile, level)
4093 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
4104 value = attrs.get('qualifierID')
4105 if value is not None and 'qualifierID' not in already_processed:
4106 already_processed.append('qualifierID')
4107 try:
4108 self.qualifierID = int(value)
4109 except ValueError, exp:
4110 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4111 value = attrs.get('default')
4112 if value is not None and 'default' not in already_processed:
4113 already_processed.append('default')
4114 if value in ('true', '1'):
4115 self.default = True
4116 elif value in ('false', '0'):
4117 self.default = False
4118 else:
4119 raise_parse_error(node, 'Bad boolean attribute')
4120 value = attrs.get('network')
4121 if value is not None and 'network' not in already_processed:
4122 already_processed.append('network')
4123 self.network = value
4124 value = attrs.get('vocabulary')
4125 if value is not None and 'vocabulary' not in already_processed:
4126 already_processed.append('vocabulary')
4127 self.vocabulary = value
4128 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4129 if nodeName_ == 'qualifierCode':
4130 qualifierCode_ = child_.text
4131 self.qualifierCode = qualifierCode_
4132
4133
4134
4136 """Contains the source of the time series, the variable, and values
4137 element which is an array of value elements and thier associated
4138 metadata (qualifiers, methods, sources, quality control level,
4139 samples)Name of the time series. optional."""
4140 subclass = None
4141 superclass = None
4142 - def __init__(self, name=None, sourceInfo=None, variable=None, values=None):
4143 self.name = _cast(None, name)
4144 self.sourceInfo = sourceInfo
4145 self.variable = variable
4146 self.values = values
4152 factory = staticmethod(factory)
4156 - def set_variable(self, variable): self.variable = variable
4158 - def set_values(self, values): self.values = values
4160 - def set_name(self, name): self.name = name
4161 - def export(self, outfile, level, namespace_='', name_='TimeSeriesType', namespacedef_=''):
4162 showIndent(outfile, level)
4163 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4164 self.exportAttributes(outfile, level, [], namespace_, name_='TimeSeriesType')
4165 if self.hasContent_():
4166 outfile.write('>\n')
4167 self.exportChildren(outfile, level + 1, namespace_, name_)
4168 showIndent(outfile, level)
4169 outfile.write('</%s%s>\n' % (namespace_, name_))
4170 else:
4171 outfile.write('/>\n')
4172 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeSeriesType'):
4174 - def exportChildren(self, outfile, level, namespace_='', name_='TimeSeriesType'):
4175 if self.sourceInfo:
4176 self.sourceInfo.export(outfile, level, namespace_, name_='sourceInfo', )
4177 if self.variable:
4178 self.variable.export(outfile, level, namespace_, name_='variable', )
4179 if self.values:
4180 self.values.export(outfile, level, namespace_, name_='values', )
4181 - def hasContent_(self):
4182 if (
4183 self.sourceInfo is not None or
4184 self.variable is not None or
4185 self.values is not None
4186 ):
4187 return True
4188 else:
4189 return False
4190 - def exportLiteral(self, outfile, level, name_='TimeSeriesType'):
4196 if self.name is not None and 'name' not in already_processed:
4197 already_processed.append('name')
4198 showIndent(outfile, level)
4199 outfile.write('name = "%s",\n' % (self.name,))
4201 if self.sourceInfo is not None:
4202 showIndent(outfile, level)
4203 outfile.write('sourceInfo=model_.SourceInfoType(\n')
4204 self.sourceInfo.exportLiteral(outfile, level, name_='sourceInfo')
4205 showIndent(outfile, level)
4206 outfile.write('),\n')
4207 if self.variable is not None:
4208 showIndent(outfile, level)
4209 outfile.write('variable=model_.VariableInfoType(\n')
4210 self.variable.exportLiteral(outfile, level, name_='variable')
4211 showIndent(outfile, level)
4212 outfile.write('),\n')
4213 if self.values is not None:
4214 showIndent(outfile, level)
4215 outfile.write('values=model_.TsValuesSingleVariableType(\n')
4216 self.values.exportLiteral(outfile, level, name_='values')
4217 showIndent(outfile, level)
4218 outfile.write('),\n')
4225 value = attrs.get('name')
4226 if value is not None and 'name' not in already_processed:
4227 already_processed.append('name')
4228 self.name = value
4229 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4242
4243
4244
4246 """NoteType defines the note element available in many defined types.
4247 the value should be the description of the note. @title should be
4248 the brief name that might be displayed as a label. @type can be
4249 used to allow for grouping of elements."""
4250 subclass = None
4251 superclass = None
4252 - def __init__(self, title=None, href=None, type_=None, show=None, valueOf_=None):
4253 self.title = _cast(None, title)
4254 self.href = _cast(None, href)
4255 self.type_ = _cast(None, type_)
4256 self.show = _cast(None, show)
4257 self.valueOf_ = valueOf_
4263 factory = staticmethod(factory)
4265 - def set_title(self, title): self.title = title
4267 - def set_href(self, href): self.href = href
4269 - def set_type(self, type_): self.type_ = type_
4271 - def set_show(self, show): self.show = show
4273 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4274 - def export(self, outfile, level, namespace_='', name_='NoteType', namespacedef_=''):
4275 showIndent(outfile, level)
4276 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4277 self.exportAttributes(outfile, level, [], namespace_, name_='NoteType')
4278 if self.hasContent_():
4279 outfile.write('>')
4280 outfile.write(self.valueOf_)
4281 self.exportChildren(outfile, level + 1, namespace_, name_)
4282 outfile.write('</%s%s>\n' % (namespace_, name_))
4283 else:
4284 outfile.write('/>\n')
4285 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NoteType'):
4286 if self.title is not None and 'title' not in already_processed:
4287 already_processed.append('title')
4288 outfile.write(' title=%s' % (self.gds_format_string(quote_attrib(self.title).encode(ExternalEncoding), input_name='title'), ))
4289 if self.href is not None and 'href' not in already_processed:
4290 already_processed.append('href')
4291 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))
4292 if self.type_ is not None and 'type_' not in already_processed:
4293 already_processed.append('type_')
4294 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
4295 if self.show is not None and 'show' not in already_processed:
4296 already_processed.append('show')
4297 outfile.write(' show=%s' % (self.gds_format_string(quote_attrib(self.show).encode(ExternalEncoding), input_name='show'), ))
4298 - def exportChildren(self, outfile, level, namespace_='', name_='NoteType'):
4300 - def hasContent_(self):
4301 if (
4302 self.valueOf_
4303 ):
4304 return True
4305 else:
4306 return False
4315 if self.title is not None and 'title' not in already_processed:
4316 already_processed.append('title')
4317 showIndent(outfile, level)
4318 outfile.write('title = "%s",\n' % (self.title,))
4319 if self.href is not None and 'href' not in already_processed:
4320 already_processed.append('href')
4321 showIndent(outfile, level)
4322 outfile.write('href = "%s",\n' % (self.href,))
4323 if self.type_ is not None and 'type_' not in already_processed:
4324 already_processed.append('type_')
4325 showIndent(outfile, level)
4326 outfile.write('type_ = "%s",\n' % (self.type_,))
4327 if self.show is not None and 'show' not in already_processed:
4328 already_processed.append('show')
4329 showIndent(outfile, level)
4330 outfile.write('show = "%s",\n' % (self.show,))
4340 value = attrs.get('title')
4341 if value is not None and 'title' not in already_processed:
4342 already_processed.append('title')
4343 self.title = value
4344 value = attrs.get('href')
4345 if value is not None and 'href' not in already_processed:
4346 already_processed.append('href')
4347 self.href = value
4348 value = attrs.get('type')
4349 if value is not None and 'type' not in already_processed:
4350 already_processed.append('type')
4351 self.type_ = value
4352 value = attrs.get('show')
4353 if value is not None and 'show' not in already_processed:
4354 already_processed.append('show')
4355 self.show = value
4356 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4358
4359
4360
4361 -class option(GeneratedsSuper):
4362 """Option elements are key-value pair elements that control how a
4363 variable maght be utilized in a service. Examples: MODIS web
4364 service. Information is aggreated over land or ocean or both.
4365 The plotarea option can include: plotarea=land, plotarea=land,
4366 plotarea=landocean USGS uses a statistic code, 0003, to repesent
4367 a value type of 'Average'. The USGS statistic codes also several
4368 options that do not fit the ODM data model."""
4369 subclass = None
4370 superclass = None
4371 - def __init__(self, optionCode=None, optionID=None, name=None, valueOf_=None):
4372 self.optionCode = _cast(None, optionCode)
4373 self.optionID = _cast(int, optionID)
4374 self.name = _cast(None, name)
4375 self.valueOf_ = valueOf_
4381 factory = staticmethod(factory)
4385 - def set_optionID(self, optionID): self.optionID = optionID
4387 - def set_name(self, name): self.name = name
4389 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4390 - def export(self, outfile, level, namespace_='', name_='option', namespacedef_=''):
4391 showIndent(outfile, level)
4392 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4393 self.exportAttributes(outfile, level, [], namespace_, name_='option')
4394 if self.hasContent_():
4395 outfile.write('>')
4396 outfile.write(self.valueOf_)
4397 self.exportChildren(outfile, level + 1, namespace_, name_)
4398 outfile.write('</%s%s>\n' % (namespace_, name_))
4399 else:
4400 outfile.write('/>\n')
4401 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='option'):
4402 if self.optionCode is not None and 'optionCode' not in already_processed:
4403 already_processed.append('optionCode')
4404 outfile.write(' optionCode=%s' % (self.gds_format_string(quote_attrib(self.optionCode).encode(ExternalEncoding), input_name='optionCode'), ))
4405 if self.optionID is not None and 'optionID' not in already_processed:
4406 already_processed.append('optionID')
4407 outfile.write(' optionID="%s"' % self.gds_format_integer(self.optionID, input_name='optionID'))
4408 if self.name is not None and 'name' not in already_processed:
4409 already_processed.append('name')
4410 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
4411 - def exportChildren(self, outfile, level, namespace_='', name_='option'):
4413 - def hasContent_(self):
4414 if (
4415 self.valueOf_
4416 ):
4417 return True
4418 else:
4419 return False
4428 if self.optionCode is not None and 'optionCode' not in already_processed:
4429 already_processed.append('optionCode')
4430 showIndent(outfile, level)
4431 outfile.write('optionCode = "%s",\n' % (self.optionCode,))
4432 if self.optionID is not None and 'optionID' not in already_processed:
4433 already_processed.append('optionID')
4434 showIndent(outfile, level)
4435 outfile.write('optionID = %d,\n' % (self.optionID,))
4436 if self.name is not None and 'name' not in already_processed:
4437 already_processed.append('name')
4438 showIndent(outfile, level)
4439 outfile.write('name = "%s",\n' % (self.name,))
4449 value = attrs.get('optionCode')
4450 if value is not None and 'optionCode' not in already_processed:
4451 already_processed.append('optionCode')
4452 self.optionCode = value
4453 self.optionCode = ' '.join(self.optionCode.split())
4454 value = attrs.get('optionID')
4455 if value is not None and 'optionID' not in already_processed:
4456 already_processed.append('optionID')
4457 try:
4458 self.optionID = int(value)
4459 except ValueError, exp:
4460 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4461 value = attrs.get('name')
4462 if value is not None and 'name' not in already_processed:
4463 already_processed.append('name')
4464 self.name = value
4465 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4467
4468
4469
4471 """Text code used by the organization that collects the data to
4472 identify the variable. The attribute @vocabulary must be set to
4473 the data source name, so the clients can subbumit variable
4474 requests to a web service (net USGS discharge variableCode
4475 @vocabularyk=NWISDV @default=true “00060”"""
4476 subclass = None
4477 superclass = None
4478 - def __init__(self, default=None, variableID=None, vocabulary=None, network=None, valueOf_=None):
4489 factory = staticmethod(factory)
4491 - def set_default(self, default): self.default = default
4499 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4500 - def export(self, outfile, level, namespace_='', name_='variableCode', namespacedef_=''):
4501 showIndent(outfile, level)
4502 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4503 self.exportAttributes(outfile, level, [], namespace_, name_='variableCode')
4504 if self.hasContent_():
4505 outfile.write('>')
4506 outfile.write(self.valueOf_)
4507 self.exportChildren(outfile, level + 1, namespace_, name_)
4508 outfile.write('</%s%s>\n' % (namespace_, name_))
4509 else:
4510 outfile.write('/>\n')
4511 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='variableCode'):
4512 if self.default is not None and 'default' not in already_processed:
4513 already_processed.append('default')
4514 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default'))
4515 if self.variableID is not None and 'variableID' not in already_processed:
4516 already_processed.append('variableID')
4517 outfile.write(' variableID="%s"' % self.gds_format_integer(self.variableID, input_name='variableID'))
4518 if self.vocabulary is not None and 'vocabulary' not in already_processed:
4519 already_processed.append('vocabulary')
4520 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), ))
4521 if self.network is not None and 'network' not in already_processed:
4522 already_processed.append('network')
4523 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), ))
4524 - def exportChildren(self, outfile, level, namespace_='', name_='variableCode'):
4526 - def hasContent_(self):
4527 if (
4528 self.valueOf_
4529 ):
4530 return True
4531 else:
4532 return False
4541 if self.default is not None and 'default' not in already_processed:
4542 already_processed.append('default')
4543 showIndent(outfile, level)
4544 outfile.write('default = %s,\n' % (self.default,))
4545 if self.variableID is not None and 'variableID' not in already_processed:
4546 already_processed.append('variableID')
4547 showIndent(outfile, level)
4548 outfile.write('variableID = %d,\n' % (self.variableID,))
4549 if self.vocabulary is not None and 'vocabulary' not in already_processed:
4550 already_processed.append('vocabulary')
4551 showIndent(outfile, level)
4552 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
4553 if self.network is not None and 'network' not in already_processed:
4554 already_processed.append('network')
4555 showIndent(outfile, level)
4556 outfile.write('network = "%s",\n' % (self.network,))
4566 value = attrs.get('default')
4567 if value is not None and 'default' not in already_processed:
4568 already_processed.append('default')
4569 if value in ('true', '1'):
4570 self.default = True
4571 elif value in ('false', '0'):
4572 self.default = False
4573 else:
4574 raise_parse_error(node, 'Bad boolean attribute')
4575 value = attrs.get('variableID')
4576 if value is not None and 'variableID' not in already_processed:
4577 already_processed.append('variableID')
4578 try:
4579 self.variableID = int(value)
4580 except ValueError, exp:
4581 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4582 value = attrs.get('vocabulary')
4583 if value is not None and 'vocabulary' not in already_processed:
4584 already_processed.append('vocabulary')
4585 self.vocabulary = value
4586 value = attrs.get('network')
4587 if value is not None and 'network' not in already_processed:
4588 already_processed.append('network')
4589 self.network = value
4590 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4592
4593
4594
4595 -class units(GeneratedsSuper):
4596 subclass = None
4597 superclass = None
4598 - def __init__(self, unitsAbbreviation=None, unitsCode=None, unitsType=None, valueOf_=None):
4599 self.unitsAbbreviation = _cast(None, unitsAbbreviation)
4600 self.unitsCode = _cast(None, unitsCode)
4601 self.unitsType = _cast(None, unitsType)
4602 self.valueOf_ = valueOf_
4608 factory = staticmethod(factory)
4619 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4620 - def export(self, outfile, level, namespace_='', name_='units', namespacedef_=''):
4621 showIndent(outfile, level)
4622 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4623 self.exportAttributes(outfile, level, [], namespace_, name_='units')
4624 if self.hasContent_():
4625 outfile.write('>')
4626 outfile.write(self.valueOf_)
4627 self.exportChildren(outfile, level + 1, namespace_, name_)
4628 outfile.write('</%s%s>\n' % (namespace_, name_))
4629 else:
4630 outfile.write('/>\n')
4631 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='units'):
4632 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed:
4633 already_processed.append('unitsAbbreviation')
4634 outfile.write(' unitsAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.unitsAbbreviation).encode(ExternalEncoding), input_name='unitsAbbreviation'), ))
4635 if self.unitsCode is not None and 'unitsCode' not in already_processed:
4636 already_processed.append('unitsCode')
4637 outfile.write(' unitsCode=%s' % (self.gds_format_string(quote_attrib(self.unitsCode).encode(ExternalEncoding), input_name='unitsCode'), ))
4638 if self.unitsType is not None and 'unitsType' not in already_processed:
4639 already_processed.append('unitsType')
4640 outfile.write(' unitsType=%s' % (quote_attrib(self.unitsType), ))
4641 - def exportChildren(self, outfile, level, namespace_='', name_='units'):
4643 - def hasContent_(self):
4644 if (
4645 self.valueOf_
4646 ):
4647 return True
4648 else:
4649 return False
4658 if self.unitsAbbreviation is not None and 'unitsAbbreviation' not in already_processed:
4659 already_processed.append('unitsAbbreviation')
4660 showIndent(outfile, level)
4661 outfile.write('unitsAbbreviation = "%s",\n' % (self.unitsAbbreviation,))
4662 if self.unitsCode is not None and 'unitsCode' not in already_processed:
4663 already_processed.append('unitsCode')
4664 showIndent(outfile, level)
4665 outfile.write('unitsCode = "%s",\n' % (self.unitsCode,))
4666 if self.unitsType is not None and 'unitsType' not in already_processed:
4667 already_processed.append('unitsType')
4668 showIndent(outfile, level)
4669 outfile.write('unitsType = "%s",\n' % (self.unitsType,))
4679 value = attrs.get('unitsAbbreviation')
4680 if value is not None and 'unitsAbbreviation' not in already_processed:
4681 already_processed.append('unitsAbbreviation')
4682 self.unitsAbbreviation = value
4683 value = attrs.get('unitsCode')
4684 if value is not None and 'unitsCode' not in already_processed:
4685 already_processed.append('unitsCode')
4686 self.unitsCode = value
4687 self.unitsCode = ' '.join(self.unitsCode.split())
4688 value = attrs.get('unitsType')
4689 if value is not None and 'unitsType' not in already_processed:
4690 already_processed.append('unitsType')
4691 self.unitsType = value
4692 - def buildChildren(self, child_, nodeName_, from_subclass=False):
4694
4695
4696
4698 subclass = None
4699 superclass = None
4700 - def __init__(self, codedVocabularyTerm=None, metadataDateTime=None, qualityControlLevel=None, methodID=None, codedVocabulary=None, sourceID=None, oid=None, censorCode=None, offsetDescription=None, sampleID=None, offsetTypeID=None, accuracyStdDev=None, offsetUnitsAbbreviation=None, offsetValue=None, dateTime=None, qualifiers=None, offsetUnitsCode=None, valueOf_=None):
4701 self.codedVocabularyTerm = _cast(None, codedVocabularyTerm)
4702 self.metadataDateTime = _cast(None, metadataDateTime)
4703 self.qualityControlLevel = _cast(None, qualityControlLevel)
4704 self.methodID = _cast(int, methodID)
4705 self.codedVocabulary = _cast(bool, codedVocabulary)
4706 self.sourceID = _cast(int, sourceID)
4707 self.oid = _cast(None, oid)
4708 self.censorCode = _cast(None, censorCode)
4709 self.offsetDescription = _cast(None, offsetDescription)
4710 self.sampleID = _cast(int, sampleID)
4711 self.offsetTypeID = _cast(int, offsetTypeID)
4712 self.accuracyStdDev = _cast(float, accuracyStdDev)
4713 self.offsetUnitsAbbreviation = _cast(None, offsetUnitsAbbreviation)
4714 self.offsetValue = _cast(float, offsetValue)
4715 self.dateTime = _cast(None, dateTime)
4716 self.qualifiers = _cast(None, qualifiers)
4717 self.offsetUnitsCode = _cast(None, offsetUnitsCode)
4718 self.valueOf_ = valueOf_
4724 factory = staticmethod(factory)
4735 - def set_methodID(self, methodID): self.methodID = methodID
4739 - def set_sourceID(self, sourceID): self.sourceID = sourceID
4740 - def get_oid(self): return self.oid
4741 - def set_oid(self, oid): self.oid = oid
4750 - def set_sampleID(self, sampleID): self.sampleID = sampleID
4760 - def set_dateTime(self, dateTime): self.dateTime = dateTime
4766 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
4767 - def export(self, outfile, level, namespace_='', name_='ValueSingleVariable', namespacedef_=''):
4768 showIndent(outfile, level)
4769 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4770 self.exportAttributes(outfile, level, [], namespace_, name_='ValueSingleVariable')
4771 if self.hasContent_():
4772 outfile.write('>')
4773 outfile.write(self.valueOf_)
4774 self.exportChildren(outfile, level + 1, namespace_, name_)
4775 outfile.write('</%s%s>\n' % (namespace_, name_))
4776 else:
4777 outfile.write('/>\n')
4778 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ValueSingleVariable'):
4779 if self.codedVocabularyTerm is not None and 'codedVocabularyTerm' not in already_processed:
4780 already_processed.append('codedVocabularyTerm')
4781 outfile.write(' codedVocabularyTerm=%s' % (self.gds_format_string(quote_attrib(self.codedVocabularyTerm).encode(ExternalEncoding), input_name='codedVocabularyTerm'), ))
4782 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
4783 already_processed.append('metadataDateTime')
4784 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), ))
4785 if self.qualityControlLevel is not None and 'qualityControlLevel' not in already_processed:
4786 already_processed.append('qualityControlLevel')
4787 outfile.write(' qualityControlLevel=%s' % (quote_attrib(self.qualityControlLevel), ))
4788 if self.methodID is not None and 'methodID' not in already_processed:
4789 already_processed.append('methodID')
4790 outfile.write(' methodID="%s"' % self.gds_format_integer(self.methodID, input_name='methodID'))
4791 if self.codedVocabulary is not None and 'codedVocabulary' not in already_processed:
4792 already_processed.append('codedVocabulary')
4793 outfile.write(' codedVocabulary="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.codedVocabulary)), input_name='codedVocabulary'))
4794 if self.sourceID is not None and 'sourceID' not in already_processed:
4795 already_processed.append('sourceID')
4796 outfile.write(' sourceID="%s"' % self.gds_format_integer(self.sourceID, input_name='sourceID'))
4797 if self.oid is not None and 'oid' not in already_processed:
4798 already_processed.append('oid')
4799 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), ))
4800 if self.censorCode is not None and 'censorCode' not in already_processed:
4801 already_processed.append('censorCode')
4802 outfile.write(' censorCode=%s' % (quote_attrib(self.censorCode), ))
4803 if self.offsetDescription is not None and 'offsetDescription' not in already_processed:
4804 already_processed.append('offsetDescription')
4805 outfile.write(' offsetDescription=%s' % (self.gds_format_string(quote_attrib(self.offsetDescription).encode(ExternalEncoding), input_name='offsetDescription'), ))
4806 if self.sampleID is not None and 'sampleID' not in already_processed:
4807 already_processed.append('sampleID')
4808 outfile.write(' sampleID="%s"' % self.gds_format_integer(self.sampleID, input_name='sampleID'))
4809 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed:
4810 already_processed.append('offsetTypeID')
4811 outfile.write(' offsetTypeID="%s"' % self.gds_format_integer(self.offsetTypeID, input_name='offsetTypeID'))
4812 if self.accuracyStdDev is not None and 'accuracyStdDev' not in already_processed:
4813 already_processed.append('accuracyStdDev')
4814 outfile.write(' accuracyStdDev="%s"' % self.gds_format_double(self.accuracyStdDev, input_name='accuracyStdDev'))
4815 if self.offsetUnitsAbbreviation is not None and 'offsetUnitsAbbreviation' not in already_processed:
4816 already_processed.append('offsetUnitsAbbreviation')
4817 outfile.write(' offsetUnitsAbbreviation=%s' % (self.gds_format_string(quote_attrib(self.offsetUnitsAbbreviation).encode(ExternalEncoding), input_name='offsetUnitsAbbreviation'), ))
4818 if self.offsetValue is not None and 'offsetValue' not in already_processed:
4819 already_processed.append('offsetValue')
4820 outfile.write(' offsetValue="%s"' % self.gds_format_double(self.offsetValue, input_name='offsetValue'))
4821 outfile.write(' dateTime=%s' % (self.gds_format_string(quote_attrib(self.dateTime).encode(ExternalEncoding), input_name='dateTime'), ))
4822 if self.qualifiers is not None and 'qualifiers' not in already_processed:
4823 already_processed.append('qualifiers')
4824 outfile.write(' qualifiers=%s' % (self.gds_format_string(quote_attrib(self.qualifiers).encode(ExternalEncoding), input_name='qualifiers'), ))
4825 if self.offsetUnitsCode is not None and 'offsetUnitsCode' not in already_processed:
4826 already_processed.append('offsetUnitsCode')
4827 outfile.write(' offsetUnitsCode=%s' % (self.gds_format_string(quote_attrib(self.offsetUnitsCode).encode(ExternalEncoding), input_name='offsetUnitsCode'), ))
4828 - def exportChildren(self, outfile, level, namespace_='', name_='ValueSingleVariable'):
4830 - def hasContent_(self):
4831 if (
4832 self.valueOf_
4833 ):
4834 return True
4835 else:
4836 return False
4837 - def exportLiteral(self, outfile, level, name_='ValueSingleVariable'):
4845 if self.codedVocabularyTerm is not None and 'codedVocabularyTerm' not in already_processed:
4846 already_processed.append('codedVocabularyTerm')
4847 showIndent(outfile, level)
4848 outfile.write('codedVocabularyTerm = "%s",\n' % (self.codedVocabularyTerm,))
4849 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
4850 already_processed.append('metadataDateTime')
4851 showIndent(outfile, level)
4852 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,))
4853 if self.qualityControlLevel is not None and 'qualityControlLevel' not in already_processed:
4854 already_processed.append('qualityControlLevel')
4855 showIndent(outfile, level)
4856 outfile.write('qualityControlLevel = "%s",\n' % (self.qualityControlLevel,))
4857 if self.methodID is not None and 'methodID' not in already_processed:
4858 already_processed.append('methodID')
4859 showIndent(outfile, level)
4860 outfile.write('methodID = %d,\n' % (self.methodID,))
4861 if self.codedVocabulary is not None and 'codedVocabulary' not in already_processed:
4862 already_processed.append('codedVocabulary')
4863 showIndent(outfile, level)
4864 outfile.write('codedVocabulary = %s,\n' % (self.codedVocabulary,))
4865 if self.sourceID is not None and 'sourceID' not in already_processed:
4866 already_processed.append('sourceID')
4867 showIndent(outfile, level)
4868 outfile.write('sourceID = %d,\n' % (self.sourceID,))
4869 if self.oid is not None and 'oid' not in already_processed:
4870 already_processed.append('oid')
4871 showIndent(outfile, level)
4872 outfile.write('oid = "%s",\n' % (self.oid,))
4873 if self.censorCode is not None and 'censorCode' not in already_processed:
4874 already_processed.append('censorCode')
4875 showIndent(outfile, level)
4876 outfile.write('censorCode = "%s",\n' % (self.censorCode,))
4877 if self.offsetDescription is not None and 'offsetDescription' not in already_processed:
4878 already_processed.append('offsetDescription')
4879 showIndent(outfile, level)
4880 outfile.write('offsetDescription = "%s",\n' % (self.offsetDescription,))
4881 if self.sampleID is not None and 'sampleID' not in already_processed:
4882 already_processed.append('sampleID')
4883 showIndent(outfile, level)
4884 outfile.write('sampleID = %d,\n' % (self.sampleID,))
4885 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed:
4886 already_processed.append('offsetTypeID')
4887 showIndent(outfile, level)
4888 outfile.write('offsetTypeID = %d,\n' % (self.offsetTypeID,))
4889 if self.accuracyStdDev is not None and 'accuracyStdDev' not in already_processed:
4890 already_processed.append('accuracyStdDev')
4891 showIndent(outfile, level)
4892 outfile.write('accuracyStdDev = %e,\n' % (self.accuracyStdDev,))
4893 if self.offsetUnitsAbbreviation is not None and 'offsetUnitsAbbreviation' not in already_processed:
4894 already_processed.append('offsetUnitsAbbreviation')
4895 showIndent(outfile, level)
4896 outfile.write('offsetUnitsAbbreviation = "%s",\n' % (self.offsetUnitsAbbreviation,))
4897 if self.offsetValue is not None and 'offsetValue' not in already_processed:
4898 already_processed.append('offsetValue')
4899 showIndent(outfile, level)
4900 outfile.write('offsetValue = %e,\n' % (self.offsetValue,))
4901 if self.dateTime is not None and 'dateTime' not in already_processed:
4902 already_processed.append('dateTime')
4903 showIndent(outfile, level)
4904 outfile.write('dateTime = "%s",\n' % (self.dateTime,))
4905 if self.qualifiers is not None and 'qualifiers' not in already_processed:
4906 already_processed.append('qualifiers')
4907 showIndent(outfile, level)
4908 outfile.write('qualifiers = "%s",\n' % (self.qualifiers,))
4909 if self.offsetUnitsCode is not None and 'offsetUnitsCode' not in already_processed:
4910 already_processed.append('offsetUnitsCode')
4911 showIndent(outfile, level)
4912 outfile.write('offsetUnitsCode = "%s",\n' % (self.offsetUnitsCode,))
4922 value = attrs.get('codedVocabularyTerm')
4923 if value is not None and 'codedVocabularyTerm' not in already_processed:
4924 already_processed.append('codedVocabularyTerm')
4925 self.codedVocabularyTerm = value
4926 value = attrs.get('metadataDateTime')
4927 if value is not None and 'metadataDateTime' not in already_processed:
4928 already_processed.append('metadataDateTime')
4929 self.metadataDateTime = value
4930 value = attrs.get('qualityControlLevel')
4931 if value is not None and 'qualityControlLevel' not in already_processed:
4932 already_processed.append('qualityControlLevel')
4933 self.qualityControlLevel = value
4934 value = attrs.get('methodID')
4935 if value is not None and 'methodID' not in already_processed:
4936 already_processed.append('methodID')
4937 try:
4938 self.methodID = int(value)
4939 except ValueError, exp:
4940 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4941 value = attrs.get('codedVocabulary')
4942 if value is not None and 'codedVocabulary' not in already_processed:
4943 already_processed.append('codedVocabulary')
4944 if value in ('true', '1'):
4945 self.codedVocabulary = True
4946 elif value in ('false', '0'):
4947 self.codedVocabulary = False
4948 else:
4949 raise_parse_error(node, 'Bad boolean attribute')
4950 value = attrs.get('sourceID')
4951 if value is not None and 'sourceID' not in already_processed:
4952 already_processed.append('sourceID')
4953 try:
4954 self.sourceID = int(value)
4955 except ValueError, exp:
4956 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4957 value = attrs.get('oid')
4958 if value is not None and 'oid' not in already_processed:
4959 already_processed.append('oid')
4960 self.oid = value
4961 value = attrs.get('censorCode')
4962 if value is not None and 'censorCode' not in already_processed:
4963 already_processed.append('censorCode')
4964 self.censorCode = value
4965 value = attrs.get('offsetDescription')
4966 if value is not None and 'offsetDescription' not in already_processed:
4967 already_processed.append('offsetDescription')
4968 self.offsetDescription = value
4969 value = attrs.get('sampleID')
4970 if value is not None and 'sampleID' not in already_processed:
4971 already_processed.append('sampleID')
4972 try:
4973 self.sampleID = int(value)
4974 except ValueError, exp:
4975 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4976 value = attrs.get('offsetTypeID')
4977 if value is not None and 'offsetTypeID' not in already_processed:
4978 already_processed.append('offsetTypeID')
4979 try:
4980 self.offsetTypeID = int(value)
4981 except ValueError, exp:
4982 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
4983 value = attrs.get('accuracyStdDev')
4984 if value is not None and 'accuracyStdDev' not in already_processed:
4985 already_processed.append('accuracyStdDev')
4986 try:
4987 self.accuracyStdDev = float(value)
4988 except ValueError, exp:
4989 raise ValueError('Bad float/double attribute (accuracyStdDev): %s' % exp)
4990 value = attrs.get('offsetUnitsAbbreviation')
4991 if value is not None and 'offsetUnitsAbbreviation' not in already_processed:
4992 already_processed.append('offsetUnitsAbbreviation')
4993 self.offsetUnitsAbbreviation = value
4994 value = attrs.get('offsetValue')
4995 if value is not None and 'offsetValue' not in already_processed:
4996 already_processed.append('offsetValue')
4997 try:
4998 self.offsetValue = float(value)
4999 except ValueError, exp:
5000 raise ValueError('Bad float/double attribute (offsetValue): %s' % exp)
5001 value = attrs.get('dateTime')
5002 if value is not None and 'dateTime' not in already_processed:
5003 already_processed.append('dateTime')
5004 self.dateTime = value
5005 value = attrs.get('qualifiers')
5006 if value is not None and 'qualifiers' not in already_processed:
5007 already_processed.append('qualifiers')
5008 self.qualifiers = value
5009 value = attrs.get('offsetUnitsCode')
5010 if value is not None and 'offsetUnitsCode' not in already_processed:
5011 already_processed.append('offsetUnitsCode')
5012 self.offsetUnitsCode = value
5013 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5015
5016
5017
5019 """VariablesResponseType is object type returned by the method
5020 GetVariableInfo. The elemnt name is variablesResponse. The
5021 request will contain a variables element containing a list of
5022 variable elements."""
5023 subclass = None
5024 superclass = None
5025 - def __init__(self, queryInfo=None, variables=None):
5033 factory = staticmethod(factory)
5038 - def export(self, outfile, level, namespace_='', name_='VariablesResponseType', namespacedef_=''):
5039 showIndent(outfile, level)
5040 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5041 self.exportAttributes(outfile, level, [], namespace_, name_='VariablesResponseType')
5042 if self.hasContent_():
5043 outfile.write('>\n')
5044 self.exportChildren(outfile, level + 1, namespace_, name_)
5045 showIndent(outfile, level)
5046 outfile.write('</%s%s>\n' % (namespace_, name_))
5047 else:
5048 outfile.write('/>\n')
5049 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='VariablesResponseType'):
5051 - def exportChildren(self, outfile, level, namespace_='', name_='VariablesResponseType'):
5052 if self.queryInfo:
5053 self.queryInfo.export(outfile, level, namespace_, name_='queryInfo', )
5054 if self.variables:
5055 self.variables.export(outfile, level, namespace_, name_='variables', )
5056 - def hasContent_(self):
5057 if (
5058 self.queryInfo is not None or
5059 self.variables is not None
5060 ):
5061 return True
5062 else:
5063 return False
5064 - def exportLiteral(self, outfile, level, name_='VariablesResponseType'):
5072 if self.queryInfo is not None:
5073 showIndent(outfile, level)
5074 outfile.write('queryInfo=model_.QueryInfoType(\n')
5075 self.queryInfo.exportLiteral(outfile, level, name_='queryInfo')
5076 showIndent(outfile, level)
5077 outfile.write('),\n')
5078 if self.variables is not None:
5079 showIndent(outfile, level)
5080 outfile.write('variables=model_.variables(\n')
5081 self.variables.exportLiteral(outfile, level)
5082 showIndent(outfile, level)
5083 outfile.write('),\n')
5091 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5100
5101
5102
5104 subclass = None
5105 superclass = None
5106 - def __init__(self, queryInfo=None, timeSeries=None):
5107 self.queryInfo = queryInfo
5108 self.timeSeries = timeSeries
5114 factory = staticmethod(factory)
5119 - def export(self, outfile, level, namespace_='', name_='TimeSeriesResponseType', namespacedef_=''):
5120 showIndent(outfile, level)
5121 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5122 self.exportAttributes(outfile, level, [], namespace_, name_='TimeSeriesResponseType')
5123 if self.hasContent_():
5124 outfile.write('>\n')
5125 self.exportChildren(outfile, level + 1, namespace_, name_)
5126 showIndent(outfile, level)
5127 outfile.write('</%s%s>\n' % (namespace_, name_))
5128 else:
5129 outfile.write('/>\n')
5130 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TimeSeriesResponseType'):
5132 - def exportChildren(self, outfile, level, namespace_='', name_='TimeSeriesResponseType'):
5133 if self.queryInfo:
5134 self.queryInfo.export(outfile, level, namespace_, name_='queryInfo', )
5135 if self.timeSeries:
5136 self.timeSeries.export(outfile, level, namespace_, name_='timeSeries', )
5137 - def hasContent_(self):
5138 if (
5139 self.queryInfo is not None or
5140 self.timeSeries is not None
5141 ):
5142 return True
5143 else:
5144 return False
5145 - def exportLiteral(self, outfile, level, name_='TimeSeriesResponseType'):
5153 if self.queryInfo is not None:
5154 showIndent(outfile, level)
5155 outfile.write('queryInfo=model_.QueryInfoType(\n')
5156 self.queryInfo.exportLiteral(outfile, level, name_='queryInfo')
5157 showIndent(outfile, level)
5158 outfile.write('),\n')
5159 if self.timeSeries is not None:
5160 showIndent(outfile, level)
5161 outfile.write('timeSeries=model_.TimeSeriesType(\n')
5162 self.timeSeries.exportLiteral(outfile, level, name_='timeSeries')
5163 showIndent(outfile, level)
5164 outfile.write('),\n')
5172 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5181
5182
5183
5185 """A sitesResponse contains a list of zero or more site elements. The
5186 siteInfo element contains the basic site information, siteName,
5187 location, siteCodes, properties. The seriesCatalog contains the
5188 list of observation series conducted at a site. A site element
5189 can have two parts: siteInfo, and one or more seriesCatalogs.
5190 Rules: GetSites(site[]) or GetSites(null), return no
5191 seriesCatalogs elements GetSiteInfo(site) return all information
5192 about a site, including the seriesCatalog."""
5193 subclass = None
5194 superclass = None
5195 - def __init__(self, queryInfo=None, site=None):
5196 self.queryInfo = queryInfo
5197 if site is None:
5198 self.site = []
5199 else:
5200 self.site = site
5206 factory = staticmethod(factory)
5213 - def export(self, outfile, level, namespace_='', name_='SiteInfoResponseType', namespacedef_=''):
5214 showIndent(outfile, level)
5215 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5216 self.exportAttributes(outfile, level, [], namespace_, name_='SiteInfoResponseType')
5217 if self.hasContent_():
5218 outfile.write('>\n')
5219 self.exportChildren(outfile, level + 1, namespace_, name_)
5220 showIndent(outfile, level)
5221 outfile.write('</%s%s>\n' % (namespace_, name_))
5222 else:
5223 outfile.write('/>\n')
5224 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SiteInfoResponseType'):
5226 - def exportChildren(self, outfile, level, namespace_='', name_='SiteInfoResponseType'):
5227 if self.queryInfo:
5228 self.queryInfo.export(outfile, level, namespace_, name_='queryInfo', )
5229 for site_ in self.site:
5230 site_.export(outfile, level, namespace_, name_='site')
5231 - def hasContent_(self):
5232 if (
5233 self.queryInfo is not None or
5234 self.site
5235 ):
5236 return True
5237 else:
5238 return False
5239 - def exportLiteral(self, outfile, level, name_='SiteInfoResponseType'):
5247 if self.queryInfo is not None:
5248 showIndent(outfile, level)
5249 outfile.write('queryInfo=model_.QueryInfoType(\n')
5250 self.queryInfo.exportLiteral(outfile, level, name_='queryInfo')
5251 showIndent(outfile, level)
5252 outfile.write('),\n')
5253 showIndent(outfile, level)
5254 outfile.write('site=[\n')
5255 level += 1
5256 for site_ in self.site:
5257 showIndent(outfile, level)
5258 outfile.write('model_.site(\n')
5259 site_.exportLiteral(outfile, level)
5260 showIndent(outfile, level)
5261 outfile.write('),\n')
5262 level -= 1
5263 showIndent(outfile, level)
5264 outfile.write('],\n')
5272 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5281
5282
5283
5284 -class site(GeneratedsSuper):
5285 """A site element can have two parts: siteInfo, and one or more
5286 seriesCatalogs. The siteInfo element contains the basic site
5287 information, siteName, location, siteCodes, properties. The
5288 seriesCatalog contains the list of observation series conducted
5289 at a site. Rules: GetSites(site[]) or GetSites(null), return no
5290 seriesCatalogs elements GetSiteInfo(site) return all information
5291 about a site, including the seriesCatalog."""
5292 subclass = None
5293 superclass = None
5294 - def __init__(self, siteInfo=None, seriesCatalog=None, extension=None):
5295 self.siteInfo = siteInfo
5296 if seriesCatalog is None:
5297 self.seriesCatalog = []
5298 else:
5299 self.seriesCatalog = seriesCatalog
5300 self.extension = extension
5306 factory = staticmethod(factory)
5308 - def set_siteInfo(self, siteInfo): self.siteInfo = siteInfo
5315 - def export(self, outfile, level, namespace_='', name_='site', namespacedef_=''):
5316 showIndent(outfile, level)
5317 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5318 self.exportAttributes(outfile, level, [], namespace_, name_='site')
5319 if self.hasContent_():
5320 outfile.write('>\n')
5321 self.exportChildren(outfile, level + 1, namespace_, name_)
5322 showIndent(outfile, level)
5323 outfile.write('</%s%s>\n' % (namespace_, name_))
5324 else:
5325 outfile.write('/>\n')
5326 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='site'):
5328 - def exportChildren(self, outfile, level, namespace_='', name_='site'):
5329 if self.siteInfo:
5330 self.siteInfo.export(outfile, level, namespace_, name_='siteInfo', )
5331 for seriesCatalog_ in self.seriesCatalog:
5332 seriesCatalog_.export(outfile, level, namespace_, name_='seriesCatalog')
5333 if self.extension is not None:
5334 showIndent(outfile, level)
5335 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
5336 - def hasContent_(self):
5337 if (
5338 self.siteInfo is not None or
5339 self.seriesCatalog or
5340 self.extension is not None
5341 ):
5342 return True
5343 else:
5344 return False
5353 if self.siteInfo is not None:
5354 showIndent(outfile, level)
5355 outfile.write('siteInfo=model_.SiteInfoType(\n')
5356 self.siteInfo.exportLiteral(outfile, level, name_='siteInfo')
5357 showIndent(outfile, level)
5358 outfile.write('),\n')
5359 showIndent(outfile, level)
5360 outfile.write('seriesCatalog=[\n')
5361 level += 1
5362 for seriesCatalog_ in self.seriesCatalog:
5363 showIndent(outfile, level)
5364 outfile.write('model_.seriesCatalogType(\n')
5365 seriesCatalog_.exportLiteral(outfile, level, name_='seriesCatalogType')
5366 showIndent(outfile, level)
5367 outfile.write('),\n')
5368 level -= 1
5369 showIndent(outfile, level)
5370 outfile.write('],\n')
5371 if self.extension is not None:
5372 showIndent(outfile, level)
5373 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
5381 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5382 if nodeName_ == 'siteInfo':
5383 obj_ = SiteInfoType.factory()
5384 obj_.build(child_)
5385 self.set_siteInfo(obj_)
5386 elif nodeName_ == 'seriesCatalog':
5387 obj_ = seriesCatalogType.factory()
5388 obj_.build(child_)
5389 self.seriesCatalog.append(obj_)
5390 elif nodeName_ == 'extension':
5391 extension_ = child_.text
5392 self.extension = extension_
5393
5394
5395
5397 """quality control levels that are used for versioning data within the
5398 database. Code used to identify the level of quality control to
5399 which data values have been subjected."""
5400 subclass = None
5401 superclass = None
5402 - def __init__(self, metadataDateTime=None, network=None, vocabulary=None, qualityControlLevelCode=None, oid=None, default=None, qualityControlLevelID=None):
5403 self.metadataDateTime = _cast(None, metadataDateTime)
5404 self.network = _cast(None, network)
5405 self.vocabulary = _cast(None, vocabulary)
5406 self.qualityControlLevelCode = _cast(None, qualityControlLevelCode)
5407 self.oid = _cast(None, oid)
5408 self.default = _cast(bool, default)
5409 self.qualityControlLevelID = qualityControlLevelID
5415 factory = staticmethod(factory)
5426 - def get_oid(self): return self.oid
5427 - def set_oid(self, oid): self.oid = oid
5429 - def set_default(self, default): self.default = default
5430 - def export(self, outfile, level, namespace_='', name_='qualityControlLevel', namespacedef_=''):
5431 showIndent(outfile, level)
5432 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5433 self.exportAttributes(outfile, level, [], namespace_, name_='qualityControlLevel')
5434 if self.hasContent_():
5435 outfile.write('>\n')
5436 self.exportChildren(outfile, level + 1, namespace_, name_)
5437 showIndent(outfile, level)
5438 outfile.write('</%s%s>\n' % (namespace_, name_))
5439 else:
5440 outfile.write('/>\n')
5441 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='qualityControlLevel'):
5442 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
5443 already_processed.append('metadataDateTime')
5444 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), ))
5445 if self.network is not None and 'network' not in already_processed:
5446 already_processed.append('network')
5447 outfile.write(' network=%s' % (self.gds_format_string(quote_attrib(self.network).encode(ExternalEncoding), input_name='network'), ))
5448 if self.vocabulary is not None and 'vocabulary' not in already_processed:
5449 already_processed.append('vocabulary')
5450 outfile.write(' vocabulary=%s' % (self.gds_format_string(quote_attrib(self.vocabulary).encode(ExternalEncoding), input_name='vocabulary'), ))
5451 if self.qualityControlLevelCode is not None and 'qualityControlLevelCode' not in already_processed:
5452 already_processed.append('qualityControlLevelCode')
5453 outfile.write(' qualityControlLevelCode=%s' % (self.gds_format_string(quote_attrib(self.qualityControlLevelCode).encode(ExternalEncoding), input_name='qualityControlLevelCode'), ))
5454 if self.oid is not None and 'oid' not in already_processed:
5455 already_processed.append('oid')
5456 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), ))
5457 if self.default is not None and 'default' not in already_processed:
5458 already_processed.append('default')
5459 outfile.write(' default="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.default)), input_name='default'))
5460 - def exportChildren(self, outfile, level, namespace_='', name_='qualityControlLevel'):
5461 if self.qualityControlLevelID is not None:
5462 showIndent(outfile, level)
5463 outfile.write('<%squalityControlLevelID>%s</%squalityControlLevelID>\n' % (namespace_, self.gds_format_string(quote_xml(self.qualityControlLevelID).encode(ExternalEncoding), input_name='qualityControlLevelID'), namespace_))
5464 - def hasContent_(self):
5465 if (
5466 self.qualityControlLevelID is not None
5467 ):
5468 return True
5469 else:
5470 return False
5471 - def exportLiteral(self, outfile, level, name_='qualityControlLevel'):
5477 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
5478 already_processed.append('metadataDateTime')
5479 showIndent(outfile, level)
5480 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,))
5481 if self.network is not None and 'network' not in already_processed:
5482 already_processed.append('network')
5483 showIndent(outfile, level)
5484 outfile.write('network = "%s",\n' % (self.network,))
5485 if self.vocabulary is not None and 'vocabulary' not in already_processed:
5486 already_processed.append('vocabulary')
5487 showIndent(outfile, level)
5488 outfile.write('vocabulary = "%s",\n' % (self.vocabulary,))
5489 if self.qualityControlLevelCode is not None and 'qualityControlLevelCode' not in already_processed:
5490 already_processed.append('qualityControlLevelCode')
5491 showIndent(outfile, level)
5492 outfile.write('qualityControlLevelCode = "%s",\n' % (self.qualityControlLevelCode,))
5493 if self.oid is not None and 'oid' not in already_processed:
5494 already_processed.append('oid')
5495 showIndent(outfile, level)
5496 outfile.write('oid = "%s",\n' % (self.oid,))
5497 if self.default is not None and 'default' not in already_processed:
5498 already_processed.append('default')
5499 showIndent(outfile, level)
5500 outfile.write('default = %s,\n' % (self.default,))
5502 if self.qualityControlLevelID is not None:
5503 showIndent(outfile, level)
5504 outfile.write('qualityControlLevelID=%s,\n' % quote_python(self.qualityControlLevelID).encode(ExternalEncoding))
5511 value = attrs.get('metadataDateTime')
5512 if value is not None and 'metadataDateTime' not in already_processed:
5513 already_processed.append('metadataDateTime')
5514 self.metadataDateTime = value
5515 value = attrs.get('network')
5516 if value is not None and 'network' not in already_processed:
5517 already_processed.append('network')
5518 self.network = value
5519 value = attrs.get('vocabulary')
5520 if value is not None and 'vocabulary' not in already_processed:
5521 already_processed.append('vocabulary')
5522 self.vocabulary = value
5523 value = attrs.get('qualityControlLevelCode')
5524 if value is not None and 'qualityControlLevelCode' not in already_processed:
5525 already_processed.append('qualityControlLevelCode')
5526 self.qualityControlLevelCode = value
5527 value = attrs.get('oid')
5528 if value is not None and 'oid' not in already_processed:
5529 already_processed.append('oid')
5530 self.oid = value
5531 value = attrs.get('default')
5532 if value is not None and 'default' not in already_processed:
5533 already_processed.append('default')
5534 if value in ('true', '1'):
5535 self.default = True
5536 elif value in ('false', '0'):
5537 self.default = False
5538 else:
5539 raise_parse_error(node, 'Bad boolean attribute')
5540 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5541 if nodeName_ == 'qualityControlLevelID':
5542 qualityControlLevelID_ = child_.text
5543 self.qualityControlLevelID = qualityControlLevelID_
5544
5545
5546
5548 """Value is the text Code used to identify the level of quality control
5549 to which data values have been subjected.Integer identifier that
5550 indicates the level of quality control that the data values have
5551 been subjected to."""
5552 subclass = None
5553 superclass = None
5554 - def __init__(self, qualityControlLevelID=None, valueOf_=None):
5555 self.qualityControlLevelID = _cast(int, qualityControlLevelID)
5556 self.valueOf_ = valueOf_
5562 factory = staticmethod(factory)
5566 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
5567 - def export(self, outfile, level, namespace_='', name_='QualityControlLevelType', namespacedef_=''):
5568 showIndent(outfile, level)
5569 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5570 self.exportAttributes(outfile, level, [], namespace_, name_='QualityControlLevelType')
5571 if self.hasContent_():
5572 outfile.write('>')
5573 outfile.write(self.valueOf_)
5574 self.exportChildren(outfile, level + 1, namespace_, name_)
5575 outfile.write('</%s%s>\n' % (namespace_, name_))
5576 else:
5577 outfile.write('/>\n')
5578 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QualityControlLevelType'):
5579 if self.qualityControlLevelID is not None and 'qualityControlLevelID' not in already_processed:
5580 already_processed.append('qualityControlLevelID')
5581 outfile.write(' qualityControlLevelID="%s"' % self.gds_format_integer(self.qualityControlLevelID, input_name='qualityControlLevelID'))
5582 - def exportChildren(self, outfile, level, namespace_='', name_='QualityControlLevelType'):
5584 - def hasContent_(self):
5585 if (
5586 self.valueOf_
5587 ):
5588 return True
5589 else:
5590 return False
5591 - def exportLiteral(self, outfile, level, name_='QualityControlLevelType'):
5599 if self.qualityControlLevelID is not None and 'qualityControlLevelID' not in already_processed:
5600 already_processed.append('qualityControlLevelID')
5601 showIndent(outfile, level)
5602 outfile.write('qualityControlLevelID = %d,\n' % (self.qualityControlLevelID,))
5612 value = attrs.get('qualityControlLevelID')
5613 if value is not None and 'qualityControlLevelID' not in already_processed:
5614 already_processed.append('qualityControlLevelID')
5615 try:
5616 self.qualityControlLevelID = int(value)
5617 except ValueError, exp:
5618 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5619 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5621
5622
5623
5625 subclass = None
5626 superclass = None
5627 - def __init__(self, UnitID=None, UnitName=None, UnitDescription=None, UnitType=None, UnitAbbreviation=None):
5628 self.UnitID = _cast(int, UnitID)
5629 self.UnitName = UnitName
5630 self.UnitDescription = UnitDescription
5631 self.UnitType = UnitType
5632 self.UnitAbbreviation = UnitAbbreviation
5638 factory = staticmethod(factory)
5640 - def set_UnitName(self, UnitName): self.UnitName = UnitName
5644 - def set_UnitType(self, UnitType): self.UnitType = UnitType
5651 - def set_UnitID(self, UnitID): self.UnitID = UnitID
5652 - def export(self, outfile, level, namespace_='', name_='UnitsType', namespacedef_=''):
5653 showIndent(outfile, level)
5654 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5655 self.exportAttributes(outfile, level, [], namespace_, name_='UnitsType')
5656 if self.hasContent_():
5657 outfile.write('>\n')
5658 self.exportChildren(outfile, level + 1, namespace_, name_)
5659 showIndent(outfile, level)
5660 outfile.write('</%s%s>\n' % (namespace_, name_))
5661 else:
5662 outfile.write('/>\n')
5663 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UnitsType'):
5664 if self.UnitID is not None and 'UnitID' not in already_processed:
5665 already_processed.append('UnitID')
5666 outfile.write(' UnitID="%s"' % self.gds_format_integer(self.UnitID, input_name='UnitID'))
5667 - def exportChildren(self, outfile, level, namespace_='', name_='UnitsType'):
5668 if self.UnitName is not None:
5669 showIndent(outfile, level)
5670 outfile.write('<%sUnitName>%s</%sUnitName>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitName).encode(ExternalEncoding), input_name='UnitName'), namespace_))
5671 if self.UnitDescription is not None:
5672 showIndent(outfile, level)
5673 outfile.write('<%sUnitDescription>%s</%sUnitDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitDescription).encode(ExternalEncoding), input_name='UnitDescription'), namespace_))
5674 if self.UnitType is not None:
5675 showIndent(outfile, level)
5676 outfile.write('<%sUnitType>%s</%sUnitType>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitType).encode(ExternalEncoding), input_name='UnitType'), namespace_))
5677 if self.UnitAbbreviation is not None:
5678 showIndent(outfile, level)
5679 outfile.write('<%sUnitAbbreviation>%s</%sUnitAbbreviation>\n' % (namespace_, self.gds_format_string(quote_xml(self.UnitAbbreviation).encode(ExternalEncoding), input_name='UnitAbbreviation'), namespace_))
5680 - def hasContent_(self):
5681 if (
5682 self.UnitName is not None or
5683 self.UnitDescription is not None or
5684 self.UnitType is not None or
5685 self.UnitAbbreviation is not None
5686 ):
5687 return True
5688 else:
5689 return False
5696 if self.UnitID is not None and 'UnitID' not in already_processed:
5697 already_processed.append('UnitID')
5698 showIndent(outfile, level)
5699 outfile.write('UnitID = %d,\n' % (self.UnitID,))
5719 value = attrs.get('UnitID')
5720 if value is not None and 'UnitID' not in already_processed:
5721 already_processed.append('UnitID')
5722 try:
5723 self.UnitID = int(value)
5724 except ValueError, exp:
5725 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5726 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5727 if nodeName_ == 'UnitName':
5728 UnitName_ = child_.text
5729 self.UnitName = UnitName_
5730 elif nodeName_ == 'UnitDescription':
5731 UnitDescription_ = child_.text
5732 self.UnitDescription = UnitDescription_
5733 elif nodeName_ == 'UnitType':
5734 UnitType_ = child_.text
5735 self.UnitType = UnitType_
5736 self.validate_UnitType(self.UnitType)
5737 elif nodeName_ == 'UnitAbbreviation':
5738 UnitAbbreviation_ = child_.text
5739 self.UnitAbbreviation = UnitAbbreviation_
5740
5741
5742
5744 """Method used to collect the data and any additional information about
5745 the method. @methodId is the link to value/@method As per
5746 communication from the ODM designers, multiple instruments
5747 observing the same variable, should be different methods.
5748 Methods should describe the manner in which the observation was
5749 collected (i.e., collected manually, or collected using an
5750 automated sampler) or measured (i.e., measured using a
5751 temperature sensor or measured using a turbidity sensor).
5752 Details about the specific sensor models and manufacturers can
5753 be included in the MethodDescription"""
5754 subclass = None
5755 superclass = None
5756 - def __init__(self, methodID=None, MethodDescription=None, MethodLink=None):
5765 factory = staticmethod(factory)
5771 - def set_methodID(self, methodID): self.methodID = methodID
5772 - def export(self, outfile, level, namespace_='', name_='MethodType', namespacedef_=''):
5773 showIndent(outfile, level)
5774 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5775 self.exportAttributes(outfile, level, [], namespace_, name_='MethodType')
5776 if self.hasContent_():
5777 outfile.write('>\n')
5778 self.exportChildren(outfile, level + 1, namespace_, name_)
5779 showIndent(outfile, level)
5780 outfile.write('</%s%s>\n' % (namespace_, name_))
5781 else:
5782 outfile.write('/>\n')
5783 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MethodType'):
5784 if self.methodID is not None and 'methodID' not in already_processed:
5785 already_processed.append('methodID')
5786 outfile.write(' methodID="%s"' % self.gds_format_integer(self.methodID, input_name='methodID'))
5787 - def exportChildren(self, outfile, level, namespace_='', name_='MethodType'):
5794 - def hasContent_(self):
5795 if (
5796 self.MethodDescription is not None or
5797 self.MethodLink is not None
5798 ):
5799 return True
5800 else:
5801 return False
5808 if self.methodID is not None and 'methodID' not in already_processed:
5809 already_processed.append('methodID')
5810 showIndent(outfile, level)
5811 outfile.write('methodID = %d,\n' % (self.methodID,))
5825 value = attrs.get('methodID')
5826 if value is not None and 'methodID' not in already_processed:
5827 already_processed.append('methodID')
5828 try:
5829 self.methodID = int(value)
5830 except ValueError, exp:
5831 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5832 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5833 if nodeName_ == 'MethodDescription':
5834 MethodDescription_ = child_.text
5835 self.MethodDescription = MethodDescription_
5836 elif nodeName_ == 'MethodLink':
5837 MethodLink_ = child_.text
5838 self.MethodLink = MethodLink_
5839
5840
5841
5843 """information about physical samples analyzed in a laboratory.
5844 @sampleID is the link to the datavalues/@sampleID LabSampleCode
5845 is the sample code. In WaterML 1.1 this will be the link to the
5846 dataValue SampleType describes the the sample type LabMethod is
5847 a LabMethodType containing infomration about lab methods"""
5848 subclass = None
5849 superclass = None
5850 - def __init__(self, sampleID=None, labSampleCode=None, SampleType=None, LabMethod=None):
5851 self.sampleID = _cast(int, sampleID)
5852 self.labSampleCode = labSampleCode
5853 self.SampleType = SampleType
5854 self.LabMethod = LabMethod
5860 factory = staticmethod(factory)
5871 - def set_sampleID(self, sampleID): self.sampleID = sampleID
5872 - def export(self, outfile, level, namespace_='', name_='SampleType', namespacedef_=''):
5873 showIndent(outfile, level)
5874 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5875 self.exportAttributes(outfile, level, [], namespace_, name_='SampleType')
5876 if self.hasContent_():
5877 outfile.write('>\n')
5878 self.exportChildren(outfile, level + 1, namespace_, name_)
5879 showIndent(outfile, level)
5880 outfile.write('</%s%s>\n' % (namespace_, name_))
5881 else:
5882 outfile.write('/>\n')
5883 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SampleType'):
5884 if self.sampleID is not None and 'sampleID' not in already_processed:
5885 already_processed.append('sampleID')
5886 outfile.write(' sampleID="%s"' % self.gds_format_integer(self.sampleID, input_name='sampleID'))
5887 - def exportChildren(self, outfile, level, namespace_='', name_='SampleType'):
5888 if self.labSampleCode is not None:
5889 showIndent(outfile, level)
5890 outfile.write('<%slabSampleCode>%s</%slabSampleCode>\n' % (namespace_, self.gds_format_string(quote_xml(self.labSampleCode).encode(ExternalEncoding), input_name='labSampleCode'), namespace_))
5891 if self.SampleType is not None:
5892 showIndent(outfile, level)
5893 outfile.write('<%sSampleType>%s</%sSampleType>\n' % (namespace_, self.gds_format_string(quote_xml(self.SampleType).encode(ExternalEncoding), input_name='SampleType'), namespace_))
5894 if self.LabMethod:
5895 self.LabMethod.export(outfile, level, namespace_, name_='LabMethod')
5896 - def hasContent_(self):
5897 if (
5898 self.labSampleCode is not None or
5899 self.SampleType is not None or
5900 self.LabMethod is not None
5901 ):
5902 return True
5903 else:
5904 return False
5911 if self.sampleID is not None and 'sampleID' not in already_processed:
5912 already_processed.append('sampleID')
5913 showIndent(outfile, level)
5914 outfile.write('sampleID = %d,\n' % (self.sampleID,))
5934 value = attrs.get('sampleID')
5935 if value is not None and 'sampleID' not in already_processed:
5936 already_processed.append('sampleID')
5937 try:
5938 self.sampleID = int(value)
5939 except ValueError, exp:
5940 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
5941 - def buildChildren(self, child_, nodeName_, from_subclass=False):
5942 if nodeName_ == 'labSampleCode':
5943 labSampleCode_ = child_.text
5944 self.labSampleCode = labSampleCode_
5945 elif nodeName_ == 'SampleType':
5946 SampleType_ = child_.text
5947 self.SampleType = SampleType_
5948 self.validate_SampleType(self.SampleType)
5949 elif nodeName_ == 'LabMethod':
5950 obj_ = LabMethodType.factory()
5951 obj_.build(child_)
5952 self.set_LabMethod(obj_)
5953
5954
5955
5957 """contains descriptions of the laboratory methods used to analyze
5958 physical samples for specific constituents.Unique integer
5959 identifier for each laboratory method. This is the key used by
5960 the Samples table to reference a laboratory method."""
5961 subclass = None
5962 superclass = None
5963 - def __init__(self, labMethodID=None, labName=None, labOrganization=None, LabMethodName=None, labMethodDescription=None, labMethodLink=None):
5964 self.labMethodID = _cast(int, labMethodID)
5965 self.labName = labName
5966 self.labOrganization = labOrganization
5967 self.LabMethodName = LabMethodName
5968 self.labMethodDescription = labMethodDescription
5969 self.labMethodLink = labMethodLink
5975 factory = staticmethod(factory)
5977 - def set_labName(self, labName): self.labName = labName
5988 - def export(self, outfile, level, namespace_='', name_='LabMethodType', namespacedef_=''):
5989 showIndent(outfile, level)
5990 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5991 self.exportAttributes(outfile, level, [], namespace_, name_='LabMethodType')
5992 if self.hasContent_():
5993 outfile.write('>\n')
5994 self.exportChildren(outfile, level + 1, namespace_, name_)
5995 showIndent(outfile, level)
5996 outfile.write('</%s%s>\n' % (namespace_, name_))
5997 else:
5998 outfile.write('/>\n')
5999 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LabMethodType'):
6000 if self.labMethodID is not None and 'labMethodID' not in already_processed:
6001 already_processed.append('labMethodID')
6002 outfile.write(' labMethodID="%s"' % self.gds_format_integer(self.labMethodID, input_name='labMethodID'))
6003 - def exportChildren(self, outfile, level, namespace_='', name_='LabMethodType'):
6004 if self.labName is not None:
6005 showIndent(outfile, level)
6006 outfile.write('<%slabName>%s</%slabName>\n' % (namespace_, self.gds_format_string(quote_xml(self.labName).encode(ExternalEncoding), input_name='labName'), namespace_))
6007 if self.labOrganization is not None:
6008 showIndent(outfile, level)
6009 outfile.write('<%slabOrganization>%s</%slabOrganization>\n' % (namespace_, self.gds_format_string(quote_xml(self.labOrganization).encode(ExternalEncoding), input_name='labOrganization'), namespace_))
6010 if self.LabMethodName is not None:
6011 showIndent(outfile, level)
6012 outfile.write('<%sLabMethodName>%s</%sLabMethodName>\n' % (namespace_, self.gds_format_string(quote_xml(self.LabMethodName).encode(ExternalEncoding), input_name='LabMethodName'), namespace_))
6013 if self.labMethodDescription is not None:
6014 showIndent(outfile, level)
6015 outfile.write('<%slabMethodDescription>%s</%slabMethodDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.labMethodDescription).encode(ExternalEncoding), input_name='labMethodDescription'), namespace_))
6016 if self.labMethodLink is not None:
6017 showIndent(outfile, level)
6018 outfile.write('<%slabMethodLink>%s</%slabMethodLink>\n' % (namespace_, self.gds_format_string(quote_xml(self.labMethodLink).encode(ExternalEncoding), input_name='labMethodLink'), namespace_))
6019 - def hasContent_(self):
6020 if (
6021 self.labName is not None or
6022 self.labOrganization is not None or
6023 self.LabMethodName is not None or
6024 self.labMethodDescription is not None or
6025 self.labMethodLink is not None
6026 ):
6027 return True
6028 else:
6029 return False
6030 - def exportLiteral(self, outfile, level, name_='LabMethodType'):
6036 if self.labMethodID is not None and 'labMethodID' not in already_processed:
6037 already_processed.append('labMethodID')
6038 showIndent(outfile, level)
6039 outfile.write('labMethodID = %d,\n' % (self.labMethodID,))
6041 if self.labName is not None:
6042 showIndent(outfile, level)
6043 outfile.write('labName=%s,\n' % quote_python(self.labName).encode(ExternalEncoding))
6044 if self.labOrganization is not None:
6045 showIndent(outfile, level)
6046 outfile.write('labOrganization=%s,\n' % quote_python(self.labOrganization).encode(ExternalEncoding))
6047 if self.LabMethodName is not None:
6048 showIndent(outfile, level)
6049 outfile.write('LabMethodName=%s,\n' % quote_python(self.LabMethodName).encode(ExternalEncoding))
6050 if self.labMethodDescription is not None:
6051 showIndent(outfile, level)
6052 outfile.write('labMethodDescription=%s,\n' % quote_python(self.labMethodDescription).encode(ExternalEncoding))
6053 if self.labMethodLink is not None:
6054 showIndent(outfile, level)
6055 outfile.write('labMethodLink=%s,\n' % quote_python(self.labMethodLink).encode(ExternalEncoding))
6062 value = attrs.get('labMethodID')
6063 if value is not None and 'labMethodID' not in already_processed:
6064 already_processed.append('labMethodID')
6065 try:
6066 self.labMethodID = int(value)
6067 except ValueError, exp:
6068 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
6069 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6070 if nodeName_ == 'labName':
6071 labName_ = child_.text
6072 self.labName = labName_
6073 elif nodeName_ == 'labOrganization':
6074 labOrganization_ = child_.text
6075 self.labOrganization = labOrganization_
6076 elif nodeName_ == 'LabMethodName':
6077 LabMethodName_ = child_.text
6078 self.LabMethodName = LabMethodName_
6079 elif nodeName_ == 'labMethodDescription':
6080 labMethodDescription_ = child_.text
6081 self.labMethodDescription = labMethodDescription_
6082 elif nodeName_ == 'labMethodLink':
6083 labMethodLink_ = child_.text
6084 self.labMethodLink = labMethodLink_
6085
6086
6087
6089 """original sources of the data, providing information sufficient to
6090 retrieve and reconstruct the data value from the original data
6091 files if necessaryUnique integer identifier that identifies each
6092 data source. link to datavalues/@sourceID"""
6093 subclass = None
6094 superclass = None
6095 - def __init__(self, sourceID=None, Organization=None, SourceDescription=None, Metadata=None, ContactInformation=None, SourceLink=None):
6107 factory = staticmethod(factory)
6119 - def set_sourceID(self, sourceID): self.sourceID = sourceID
6120 - def export(self, outfile, level, namespace_='', name_='SourceType', namespacedef_=''):
6121 showIndent(outfile, level)
6122 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6123 self.exportAttributes(outfile, level, [], namespace_, name_='SourceType')
6124 if self.hasContent_():
6125 outfile.write('>\n')
6126 self.exportChildren(outfile, level + 1, namespace_, name_)
6127 showIndent(outfile, level)
6128 outfile.write('</%s%s>\n' % (namespace_, name_))
6129 else:
6130 outfile.write('/>\n')
6131 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SourceType'):
6132 if self.sourceID is not None and 'sourceID' not in already_processed:
6133 already_processed.append('sourceID')
6134 outfile.write(' sourceID="%s"' % self.gds_format_integer(self.sourceID, input_name='sourceID'))
6135 - def exportChildren(self, outfile, level, namespace_='', name_='SourceType'):
6136 if self.Organization is not None:
6137 showIndent(outfile, level)
6138 outfile.write('<%sOrganization>%s</%sOrganization>\n' % (namespace_, self.gds_format_string(quote_xml(self.Organization).encode(ExternalEncoding), input_name='Organization'), namespace_))
6139 if self.SourceDescription is not None:
6140 showIndent(outfile, level)
6141 outfile.write('<%sSourceDescription>%s</%sSourceDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.SourceDescription).encode(ExternalEncoding), input_name='SourceDescription'), namespace_))
6142 if self.Metadata:
6143 self.Metadata.export(outfile, level, namespace_, name_='Metadata')
6144 if self.ContactInformation:
6145 self.ContactInformation.export(outfile, level, namespace_, name_='ContactInformation')
6146 if self.SourceLink is not None:
6147 showIndent(outfile, level)
6148 outfile.write('<%sSourceLink>%s</%sSourceLink>\n' % (namespace_, self.gds_format_string(quote_xml(self.SourceLink).encode(ExternalEncoding), input_name='SourceLink'), namespace_))
6149 - def hasContent_(self):
6150 if (
6151 self.Organization is not None or
6152 self.SourceDescription is not None or
6153 self.Metadata is not None or
6154 self.ContactInformation is not None or
6155 self.SourceLink is not None
6156 ):
6157 return True
6158 else:
6159 return False
6166 if self.sourceID is not None and 'sourceID' not in already_processed:
6167 already_processed.append('sourceID')
6168 showIndent(outfile, level)
6169 outfile.write('sourceID = %d,\n' % (self.sourceID,))
6171 if self.Organization is not None:
6172 showIndent(outfile, level)
6173 outfile.write('Organization=%s,\n' % quote_python(self.Organization).encode(ExternalEncoding))
6174 if self.SourceDescription is not None:
6175 showIndent(outfile, level)
6176 outfile.write('SourceDescription=%s,\n' % quote_python(self.SourceDescription).encode(ExternalEncoding))
6177 if self.Metadata is not None:
6178 showIndent(outfile, level)
6179 outfile.write('Metadata=model_.MetaDataType(\n')
6180 self.Metadata.exportLiteral(outfile, level, name_='Metadata')
6181 showIndent(outfile, level)
6182 outfile.write('),\n')
6183 if self.ContactInformation is not None:
6184 showIndent(outfile, level)
6185 outfile.write('ContactInformation=model_.ContactInformationType(\n')
6186 self.ContactInformation.exportLiteral(outfile, level, name_='ContactInformation')
6187 showIndent(outfile, level)
6188 outfile.write('),\n')
6189 if self.SourceLink is not None:
6190 showIndent(outfile, level)
6191 outfile.write('SourceLink=%s,\n' % quote_python(self.SourceLink).encode(ExternalEncoding))
6198 value = attrs.get('sourceID')
6199 if value is not None and 'sourceID' not in already_processed:
6200 already_processed.append('sourceID')
6201 try:
6202 self.sourceID = int(value)
6203 except ValueError, exp:
6204 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
6205 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6223
6224
6225
6341
6342
6343
6464
6465
6466
6468 """OffsetType contains full descriptive information for each of the
6469 measurement offsets. A set of observations may be done at an
6470 offset for the central location. offsetTypeID links to
6471 dataValue/@offsetTypeIdUnique integer identifier that identifies
6472 the type of measurement offset. Suggested that this is
6473 offsetType from ODM database."""
6474 subclass = None
6475 superclass = None
6476 - def __init__(self, offsetTypeID=None, offsetValue=None, offsetDescription=None, units=None, offsetIsVertical='true', offsetHorizDirectionDegrees=None):
6477 self.offsetTypeID = _cast(int, offsetTypeID)
6478 self.offsetValue = offsetValue
6479 self.offsetDescription = offsetDescription
6480 self.units = units
6481 self.offsetIsVertical = offsetIsVertical
6482 self.offsetHorizDirectionDegrees = offsetHorizDirectionDegrees
6488 factory = staticmethod(factory)
6501 - def export(self, outfile, level, namespace_='', name_='OffsetType', namespacedef_=''):
6502 showIndent(outfile, level)
6503 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6504 self.exportAttributes(outfile, level, [], namespace_, name_='OffsetType')
6505 if self.hasContent_():
6506 outfile.write('>\n')
6507 self.exportChildren(outfile, level + 1, namespace_, name_)
6508 showIndent(outfile, level)
6509 outfile.write('</%s%s>\n' % (namespace_, name_))
6510 else:
6511 outfile.write('/>\n')
6512 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='OffsetType'):
6513 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed:
6514 already_processed.append('offsetTypeID')
6515 outfile.write(' offsetTypeID="%s"' % self.gds_format_integer(self.offsetTypeID, input_name='offsetTypeID'))
6516 - def exportChildren(self, outfile, level, namespace_='', name_='OffsetType'):
6517 if self.offsetValue is not None:
6518 showIndent(outfile, level)
6519 outfile.write('<%soffsetValue>%s</%soffsetValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetValue).encode(ExternalEncoding), input_name='offsetValue'), namespace_))
6520 if self.offsetDescription is not None:
6521 showIndent(outfile, level)
6522 outfile.write('<%soffsetDescription>%s</%soffsetDescription>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetDescription).encode(ExternalEncoding), input_name='offsetDescription'), namespace_))
6523 if self.units:
6524 self.units.export(outfile, level, namespace_, name_='units', )
6525 if self.offsetIsVertical is not None:
6526 showIndent(outfile, level)
6527 outfile.write('<%soffsetIsVertical>%s</%soffsetIsVertical>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetIsVertical).encode(ExternalEncoding), input_name='offsetIsVertical'), namespace_))
6528 if self.offsetHorizDirectionDegrees is not None:
6529 showIndent(outfile, level)
6530 outfile.write('<%soffsetHorizDirectionDegrees>%s</%soffsetHorizDirectionDegrees>\n' % (namespace_, self.gds_format_string(quote_xml(self.offsetHorizDirectionDegrees).encode(ExternalEncoding), input_name='offsetHorizDirectionDegrees'), namespace_))
6531 - def hasContent_(self):
6532 if (
6533 self.offsetValue is not None or
6534 self.offsetDescription is not None or
6535 self.units is not None or
6536 self.offsetIsVertical is not None or
6537 self.offsetHorizDirectionDegrees is not None
6538 ):
6539 return True
6540 else:
6541 return False
6548 if self.offsetTypeID is not None and 'offsetTypeID' not in already_processed:
6549 already_processed.append('offsetTypeID')
6550 showIndent(outfile, level)
6551 outfile.write('offsetTypeID = %d,\n' % (self.offsetTypeID,))
6553 if self.offsetValue is not None:
6554 showIndent(outfile, level)
6555 outfile.write('offsetValue=%s,\n' % quote_python(self.offsetValue).encode(ExternalEncoding))
6556 if self.offsetDescription is not None:
6557 showIndent(outfile, level)
6558 outfile.write('offsetDescription=%s,\n' % quote_python(self.offsetDescription).encode(ExternalEncoding))
6559 if self.units is not None:
6560 showIndent(outfile, level)
6561 outfile.write('units=model_.units(\n')
6562 self.units.exportLiteral(outfile, level)
6563 showIndent(outfile, level)
6564 outfile.write('),\n')
6565 if self.offsetIsVertical is not None:
6566 showIndent(outfile, level)
6567 outfile.write('offsetIsVertical=%s,\n' % quote_python(self.offsetIsVertical).encode(ExternalEncoding))
6568 if self.offsetHorizDirectionDegrees is not None:
6569 showIndent(outfile, level)
6570 outfile.write('offsetHorizDirectionDegrees=%s,\n' % quote_python(self.offsetHorizDirectionDegrees).encode(ExternalEncoding))
6577 value = attrs.get('offsetTypeID')
6578 if value is not None and 'offsetTypeID' not in already_processed:
6579 already_processed.append('offsetTypeID')
6580 try:
6581 self.offsetTypeID = int(value)
6582 except ValueError, exp:
6583 raise_parse_error(node, 'Bad integer attribute: %s' % exp)
6584 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6585 if nodeName_ == 'offsetValue':
6586 offsetValue_ = child_.text
6587 self.offsetValue = offsetValue_
6588 elif nodeName_ == 'offsetDescription':
6589 offsetDescription_ = child_.text
6590 self.offsetDescription = offsetDescription_
6591 elif nodeName_ == 'units':
6592 obj_ = units.factory()
6593 obj_.build(child_)
6594 self.set_units(obj_)
6595 elif nodeName_ == 'offsetIsVertical':
6596 offsetIsVertical_ = child_.text
6597 self.offsetIsVertical = offsetIsVertical_
6598 elif nodeName_ == 'offsetHorizDirectionDegrees':
6599 offsetHorizDirectionDegrees_ = child_.text
6600 self.offsetHorizDirectionDegrees = offsetHorizDirectionDegrees_
6601
6602
6603
6605 """A sampling station is any place where data are collected.
6606 SiteInfoType is the Element that for the core information about
6607 a point sampling location. The core information includes
6608 SiteName, SiteCode(s), location, elevation, timeZone information
6609 and note(s). SiteInfoType is <siteInfo> in a <site> of a
6610 <sitesResponse>. It is derived from SourceType so that other
6611 geographic location descriptions can be utilized in the
6612 <sourceInfo> of the <timeSeriesResponse>"""
6613 subclass = None
6614 superclass = SourceInfoType
6615 - def __init__(self, metadataDateTime=None, oid=None, siteName=None, siteCode=None, timeZoneInfo=None, geoLocation=None, elevation_m=None, verticalDatum=None, note=None, extension=None, altname=None):
6639 factory = staticmethod(factory)
6641 - def set_siteName(self, siteName): self.siteName = siteName
6655 - def set_note(self, note): self.note = note
6656 - def add_note(self, value): self.note.append(value)
6661 - def set_altname(self, altname): self.altname = altname
6664 - def get_oid(self): return self.oid
6665 - def set_oid(self, oid): self.oid = oid
6666 - def export(self, outfile, level, namespace_='', name_='SiteInfoType', namespacedef_=''):
6667 showIndent(outfile, level)
6668 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6669 self.exportAttributes(outfile, level, [], namespace_, name_='SiteInfoType')
6670 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
6671 outfile.write(' xsi:type="SiteInfoType"')
6672 if self.hasContent_():
6673 outfile.write('>\n')
6674 self.exportChildren(outfile, level + 1, namespace_, name_)
6675 showIndent(outfile, level)
6676 outfile.write('</%s%s>\n' % (namespace_, name_))
6677 else:
6678 outfile.write('/>\n')
6679 - def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SiteInfoType'):
6680 super(SiteInfoType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SiteInfoType')
6681 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
6682 already_processed.append('metadataDateTime')
6683 outfile.write(' metadataDateTime=%s' % (self.gds_format_string(quote_attrib(self.metadataDateTime).encode(ExternalEncoding), input_name='metadataDateTime'), ))
6684 if self.oid is not None and 'oid' not in already_processed:
6685 already_processed.append('oid')
6686 outfile.write(' oid=%s' % (self.gds_format_string(quote_attrib(self.oid).encode(ExternalEncoding), input_name='oid'), ))
6687 - def exportChildren(self, outfile, level, namespace_='', name_='SiteInfoType'):
6688 super(SiteInfoType, self).exportChildren(outfile, level, namespace_, name_)
6689 if self.siteName is not None:
6690 showIndent(outfile, level)
6691 outfile.write('<%ssiteName>%s</%ssiteName>\n' % (namespace_, self.gds_format_string(quote_xml(self.siteName).encode(ExternalEncoding), input_name='siteName'), namespace_))
6692 for siteCode_ in self.siteCode:
6693 siteCode_.export(outfile, level, namespace_, name_='siteCode')
6694 if self.timeZoneInfo:
6695 self.timeZoneInfo.export(outfile, level, namespace_, name_='timeZoneInfo')
6696 if self.geoLocation:
6697 self.geoLocation.export(outfile, level, namespace_, name_='geoLocation')
6698 if self.elevation_m is not None:
6699 showIndent(outfile, level)
6700 outfile.write('<%selevation_m>%s</%selevation_m>\n' % (namespace_, self.gds_format_string(quote_xml(self.elevation_m).encode(ExternalEncoding), input_name='elevation_m'), namespace_))
6701 if self.verticalDatum is not None:
6702 showIndent(outfile, level)
6703 outfile.write('<%sverticalDatum>%s</%sverticalDatum>\n' % (namespace_, self.gds_format_string(quote_xml(self.verticalDatum).encode(ExternalEncoding), input_name='verticalDatum'), namespace_))
6704 for note_ in self.note:
6705 note_.export(outfile, level, namespace_, name_='note')
6706 if self.extension is not None:
6707 showIndent(outfile, level)
6708 outfile.write('<%sextension>%s</%sextension>\n' % (namespace_, self.gds_format_string(quote_xml(self.extension).encode(ExternalEncoding), input_name='extension'), namespace_))
6709 if self.altname is not None:
6710 showIndent(outfile, level)
6711 outfile.write('<%saltname>%s</%saltname>\n' % (namespace_, self.gds_format_string(quote_xml(self.altname).encode(ExternalEncoding), input_name='altname'), namespace_))
6712 - def hasContent_(self):
6713 if (
6714 self.siteName is not None or
6715 self.siteCode or
6716 self.timeZoneInfo is not None or
6717 self.geoLocation is not None or
6718 self.elevation_m is not None or
6719 self.verticalDatum is not None or
6720 self.note or
6721 self.extension is not None or
6722 self.altname is not None or
6723 super(SiteInfoType, self).hasContent_()
6724 ):
6725 return True
6726 else:
6727 return False
6734 if self.metadataDateTime is not None and 'metadataDateTime' not in already_processed:
6735 already_processed.append('metadataDateTime')
6736 showIndent(outfile, level)
6737 outfile.write('metadataDateTime = "%s",\n' % (self.metadataDateTime,))
6738 if self.oid is not None and 'oid' not in already_processed:
6739 already_processed.append('oid')
6740 showIndent(outfile, level)
6741 outfile.write('oid = "%s",\n' % (self.oid,))
6742 super(SiteInfoType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
6744 super(SiteInfoType, self).exportLiteralChildren(outfile, level, name_)
6745 if self.siteName is not None:
6746 showIndent(outfile, level)
6747 outfile.write('siteName=%s,\n' % quote_python(self.siteName).encode(ExternalEncoding))
6748 showIndent(outfile, level)
6749 outfile.write('siteCode=[\n')
6750 level += 1
6751 for siteCode_ in self.siteCode:
6752 showIndent(outfile, level)
6753 outfile.write('model_.siteCode(\n')
6754 siteCode_.exportLiteral(outfile, level)
6755 showIndent(outfile, level)
6756 outfile.write('),\n')
6757 level -= 1
6758 showIndent(outfile, level)
6759 outfile.write('],\n')
6760 if self.timeZoneInfo is not None:
6761 showIndent(outfile, level)
6762 outfile.write('timeZoneInfo=model_.timeZoneInfo(\n')
6763 self.timeZoneInfo.exportLiteral(outfile, level)
6764 showIndent(outfile, level)
6765 outfile.write('),\n')
6766 if self.geoLocation is not None:
6767 showIndent(outfile, level)
6768 outfile.write('geoLocation=model_.geoLocation(\n')
6769 self.geoLocation.exportLiteral(outfile, level)
6770 showIndent(outfile, level)
6771 outfile.write('),\n')
6772 if self.elevation_m is not None:
6773 showIndent(outfile, level)
6774 outfile.write('elevation_m=%s,\n' % quote_python(self.elevation_m).encode(ExternalEncoding))
6775 if self.verticalDatum is not None:
6776 showIndent(outfile, level)
6777 outfile.write('verticalDatum=%s,\n' % quote_python(self.verticalDatum).encode(ExternalEncoding))
6778 showIndent(outfile, level)
6779 outfile.write('note=[\n')
6780 level += 1
6781 for note_ in self.note:
6782 showIndent(outfile, level)
6783 outfile.write('model_.NoteType(\n')
6784 note_.exportLiteral(outfile, level, name_='NoteType')
6785 showIndent(outfile, level)
6786 outfile.write('),\n')
6787 level -= 1
6788 showIndent(outfile, level)
6789 outfile.write('],\n')
6790 if self.extension is not None:
6791 showIndent(outfile, level)
6792 outfile.write('extension=%s,\n' % quote_python(self.extension).encode(ExternalEncoding))
6793 if self.altname is not None:
6794 showIndent(outfile, level)
6795 outfile.write('altname=%s,\n' % quote_python(self.altname).encode(ExternalEncoding))
6802 value = attrs.get('metadataDateTime')
6803 if value is not None and 'metadataDateTime' not in already_processed:
6804 already_processed.append('metadataDateTime')
6805 self.metadataDateTime = value
6806 value = attrs.get('oid')
6807 if value is not None and 'oid' not in already_processed:
6808 already_processed.append('oid')
6809 self.oid = value
6810 super(SiteInfoType, self).buildAttributes(node, attrs, already_processed)
6811 - def buildChildren(self, child_, nodeName_, from_subclass=False):
6812 if nodeName_ == 'siteName':
6813 siteName_ = child_.text
6814 self.siteName = siteName_
6815 elif nodeName_ == 'siteCode':
6816 obj_ = siteCode.factory()
6817 obj_.build(child_)
6818 self.siteCode.append(obj_)
6819 elif nodeName_ == 'timeZoneInfo':
6820 obj_ = timeZoneInfo.factory()
6821 obj_.build(child_)
6822 self.set_timeZoneInfo(obj_)
6823 elif nodeName_ == 'geoLocation':
6824 obj_ = geoLocation.factory()
6825 obj_.build(child_)
6826 self.set_geoLocation(obj_)
6827 elif nodeName_ == 'elevation_m':
6828 elevation_m_ = child_.text
6829 self.elevation_m = elevation_m_
6830 elif nodeName_ == 'verticalDatum':
6831 verticalDatum_ = child_.text
6832 self.verticalDatum = verticalDatum_
6833 elif nodeName_ == 'note':
6834 obj_ = NoteType.factory()
6835 obj_.build(child_)
6836 self.note.append(obj_)
6837 elif nodeName_ == 'extension':
6838 extension_ = child_.text
6839 self.extension = extension_
6840 elif nodeName_ == 'altname':
6841 altname_ = child_.text
6842 self.altname = altname_
6843 super(SiteInfoType, self).buildChildren(child_, nodeName_, True)
6844
6845
6846
6847
6848
6850 tag = Tag_pattern_.match(node.tag).groups()[-1]
6851 rootClass = globals().get(tag)
6852 return tag, rootClass
6853
6854
6855 __all__ = [
6856 "ContactInformationType",
6857 "DataSetInfoType",
6858 "DocumentationType",
6859 "GeogLocationType",
6860 "LabMethodType",
6861 "LatLonBoxType",
6862 "LatLonPointType",
6863 "MetaDataType",
6864 "MethodType",
6865 "NoteType",
6866 "OffsetType",
6867 "QualifiersType",
6868 "QualityControlLevelType",
6869 "QueryInfoType",
6870 "SampleType",
6871 "SiteInfoResponseType",
6872 "SiteInfoType",
6873 "SourceInfoType",
6874 "SourceType",
6875 "TimeIntervalType",
6876 "TimePeriodRealTimeType",
6877 "TimePeriodType",
6878 "TimeSeriesResponseType",
6879 "TimeSeriesType",
6880 "TimeSingleType",
6881 "TsValuesSingleVariableType",
6882 "UnitsType",
6883 "ValueSingleVariable",
6884 "VariableInfoType",
6885 "VariablesResponseType",
6886 "criteria",
6887 "daylightSavingsTimeZone",
6888 "defaultTimeZone",
6889 "geoLocation",
6890 "localSiteXY",
6891 "option",
6892 "optionGroup",
6893 "options",
6894 "parentID",
6895 "qualifier",
6896 "qualityControlLevel",
6897 "related",
6898 "relatedID",
6899 "series",
6900 "seriesCatalogType",
6901 "site",
6902 "siteCode",
6903 "timeParam",
6904 "timeSupport",
6905 "timeZoneInfo",
6906 "units",
6907 "valueCount",
6908 "variableCode",
6909 "variables"
6910 ]
6911